mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 08:21:37 +00:00
Sibi stack
This commit is contained in:
parent
ca6a1d5ba7
commit
5cae7b7d72
6
Ada/.gitignore
vendored
6
Ada/.gitignore
vendored
@ -1,6 +0,0 @@
|
||||
*.o
|
||||
*.ali
|
||||
b~*.ads
|
||||
b~*.adb
|
||||
program
|
||||
gilded_rose_tester
|
||||
23
Ada/Makefile
23
Ada/Makefile
@ -1,23 +0,0 @@
|
||||
AHVEN_INCLUDE:=-aI/usr/share/ada/adainclude/ahven -aI/usr/include/ahven
|
||||
AHVEN_LIBS:=-aO/usr/lib/x86_64-linux-gnu/ada/adalib/ahven -aO/usr/lib/ahven -aO/usr/lib -shared
|
||||
ADAFLAGS:=-gnat2012 $(AHVEN_INCLUDE) $(AHVEN_LIBS)
|
||||
LIBS:=-largs -lahven
|
||||
|
||||
.PHONY: all
|
||||
all: gilded_rose_tester program
|
||||
|
||||
.PHONY: gilded_rose_tester
|
||||
gilded_rose_tester:
|
||||
@gnatmake -q $(ADAFLAGS) gilded_rose_tester $(LIBS)
|
||||
|
||||
.PHONY: test
|
||||
test: gilded_rose_tester
|
||||
@./gilded_rose_tester
|
||||
|
||||
.PHONY: program
|
||||
program:
|
||||
@gnatmake -q $(ADAFLAGS) program $(LIBS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@gnatclean -q gilded_rose_tester program
|
||||
@ -1,8 +0,0 @@
|
||||
You will need the following programs:
|
||||
|
||||
- GNU make (on Debian-like systems do 'apt-get install make')
|
||||
- gcc with Ada enabled ('apt-get install gnat')
|
||||
- the ahven unit-test framework ('apt-get install libahven5-dev')
|
||||
|
||||
'make test' runs your tests once.
|
||||
|
||||
@ -1,373 +0,0 @@
|
||||
OMGHAI!
|
||||
-------- day 0 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 10, 20
|
||||
Aged Brie, 2, 0
|
||||
Elixir of the Mongoose, 5, 7
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 15, 20
|
||||
Backstage passes to a TAFKAL80ETC concert, 10, 49
|
||||
Backstage passes to a TAFKAL80ETC concert, 5, 49
|
||||
Conjured Mana Cake, 3, 6
|
||||
|
||||
-------- day 1 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 9, 19
|
||||
Aged Brie, 1, 1
|
||||
Elixir of the Mongoose, 4, 6
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 14, 21
|
||||
Backstage passes to a TAFKAL80ETC concert, 9, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, 4, 50
|
||||
Conjured Mana Cake, 2, 5
|
||||
|
||||
-------- day 2 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 8, 18
|
||||
Aged Brie, 0, 2
|
||||
Elixir of the Mongoose, 3, 5
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 13, 22
|
||||
Backstage passes to a TAFKAL80ETC concert, 8, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, 3, 50
|
||||
Conjured Mana Cake, 1, 4
|
||||
|
||||
-------- day 3 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 7, 17
|
||||
Aged Brie, -1, 4
|
||||
Elixir of the Mongoose, 2, 4
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 12, 23
|
||||
Backstage passes to a TAFKAL80ETC concert, 7, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, 2, 50
|
||||
Conjured Mana Cake, 0, 3
|
||||
|
||||
-------- day 4 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 6, 16
|
||||
Aged Brie, -2, 6
|
||||
Elixir of the Mongoose, 1, 3
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 11, 24
|
||||
Backstage passes to a TAFKAL80ETC concert, 6, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, 1, 50
|
||||
Conjured Mana Cake, -1, 1
|
||||
|
||||
-------- day 5 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 5, 15
|
||||
Aged Brie, -3, 8
|
||||
Elixir of the Mongoose, 0, 2
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 10, 25
|
||||
Backstage passes to a TAFKAL80ETC concert, 5, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, 0, 50
|
||||
Conjured Mana Cake, -2, 0
|
||||
|
||||
-------- day 6 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 4, 14
|
||||
Aged Brie, -4, 10
|
||||
Elixir of the Mongoose, -1, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 9, 27
|
||||
Backstage passes to a TAFKAL80ETC concert, 4, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -1, 0
|
||||
Conjured Mana Cake, -3, 0
|
||||
|
||||
-------- day 7 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 3, 13
|
||||
Aged Brie, -5, 12
|
||||
Elixir of the Mongoose, -2, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 8, 29
|
||||
Backstage passes to a TAFKAL80ETC concert, 3, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -2, 0
|
||||
Conjured Mana Cake, -4, 0
|
||||
|
||||
-------- day 8 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 2, 12
|
||||
Aged Brie, -6, 14
|
||||
Elixir of the Mongoose, -3, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 7, 31
|
||||
Backstage passes to a TAFKAL80ETC concert, 2, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -3, 0
|
||||
Conjured Mana Cake, -5, 0
|
||||
|
||||
-------- day 9 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 1, 11
|
||||
Aged Brie, -7, 16
|
||||
Elixir of the Mongoose, -4, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 6, 33
|
||||
Backstage passes to a TAFKAL80ETC concert, 1, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -4, 0
|
||||
Conjured Mana Cake, -6, 0
|
||||
|
||||
-------- day 10 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, 0, 10
|
||||
Aged Brie, -8, 18
|
||||
Elixir of the Mongoose, -5, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 5, 35
|
||||
Backstage passes to a TAFKAL80ETC concert, 0, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -5, 0
|
||||
Conjured Mana Cake, -7, 0
|
||||
|
||||
-------- day 11 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -1, 8
|
||||
Aged Brie, -9, 20
|
||||
Elixir of the Mongoose, -6, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 4, 38
|
||||
Backstage passes to a TAFKAL80ETC concert, -1, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -6, 0
|
||||
Conjured Mana Cake, -8, 0
|
||||
|
||||
-------- day 12 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -2, 6
|
||||
Aged Brie, -10, 22
|
||||
Elixir of the Mongoose, -7, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 3, 41
|
||||
Backstage passes to a TAFKAL80ETC concert, -2, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -7, 0
|
||||
Conjured Mana Cake, -9, 0
|
||||
|
||||
-------- day 13 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -3, 4
|
||||
Aged Brie, -11, 24
|
||||
Elixir of the Mongoose, -8, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 2, 44
|
||||
Backstage passes to a TAFKAL80ETC concert, -3, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -8, 0
|
||||
Conjured Mana Cake, -10, 0
|
||||
|
||||
-------- day 14 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -4, 2
|
||||
Aged Brie, -12, 26
|
||||
Elixir of the Mongoose, -9, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 1, 47
|
||||
Backstage passes to a TAFKAL80ETC concert, -4, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -9, 0
|
||||
Conjured Mana Cake, -11, 0
|
||||
|
||||
-------- day 15 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -5, 0
|
||||
Aged Brie, -13, 28
|
||||
Elixir of the Mongoose, -10, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, 0, 50
|
||||
Backstage passes to a TAFKAL80ETC concert, -5, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -10, 0
|
||||
Conjured Mana Cake, -12, 0
|
||||
|
||||
-------- day 16 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -6, 0
|
||||
Aged Brie, -14, 30
|
||||
Elixir of the Mongoose, -11, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -1, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -6, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -11, 0
|
||||
Conjured Mana Cake, -13, 0
|
||||
|
||||
-------- day 17 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -7, 0
|
||||
Aged Brie, -15, 32
|
||||
Elixir of the Mongoose, -12, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -2, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -7, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -12, 0
|
||||
Conjured Mana Cake, -14, 0
|
||||
|
||||
-------- day 18 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -8, 0
|
||||
Aged Brie, -16, 34
|
||||
Elixir of the Mongoose, -13, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -3, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -8, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -13, 0
|
||||
Conjured Mana Cake, -15, 0
|
||||
|
||||
-------- day 19 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -9, 0
|
||||
Aged Brie, -17, 36
|
||||
Elixir of the Mongoose, -14, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -4, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -9, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -14, 0
|
||||
Conjured Mana Cake, -16, 0
|
||||
|
||||
-------- day 20 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -10, 0
|
||||
Aged Brie, -18, 38
|
||||
Elixir of the Mongoose, -15, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -5, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -10, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -15, 0
|
||||
Conjured Mana Cake, -17, 0
|
||||
|
||||
-------- day 21 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -11, 0
|
||||
Aged Brie, -19, 40
|
||||
Elixir of the Mongoose, -16, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -6, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -11, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -16, 0
|
||||
Conjured Mana Cake, -18, 0
|
||||
|
||||
-------- day 22 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -12, 0
|
||||
Aged Brie, -20, 42
|
||||
Elixir of the Mongoose, -17, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -7, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -12, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -17, 0
|
||||
Conjured Mana Cake, -19, 0
|
||||
|
||||
-------- day 23 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -13, 0
|
||||
Aged Brie, -21, 44
|
||||
Elixir of the Mongoose, -18, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -8, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -13, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -18, 0
|
||||
Conjured Mana Cake, -20, 0
|
||||
|
||||
-------- day 24 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -14, 0
|
||||
Aged Brie, -22, 46
|
||||
Elixir of the Mongoose, -19, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -9, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -14, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -19, 0
|
||||
Conjured Mana Cake, -21, 0
|
||||
|
||||
-------- day 25 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -15, 0
|
||||
Aged Brie, -23, 48
|
||||
Elixir of the Mongoose, -20, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -10, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -15, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -20, 0
|
||||
Conjured Mana Cake, -22, 0
|
||||
|
||||
-------- day 26 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -16, 0
|
||||
Aged Brie, -24, 50
|
||||
Elixir of the Mongoose, -21, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -11, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -16, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -21, 0
|
||||
Conjured Mana Cake, -23, 0
|
||||
|
||||
-------- day 27 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -17, 0
|
||||
Aged Brie, -25, 50
|
||||
Elixir of the Mongoose, -22, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -12, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -17, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -22, 0
|
||||
Conjured Mana Cake, -24, 0
|
||||
|
||||
-------- day 28 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -18, 0
|
||||
Aged Brie, -26, 50
|
||||
Elixir of the Mongoose, -23, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -13, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -18, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -23, 0
|
||||
Conjured Mana Cake, -25, 0
|
||||
|
||||
-------- day 29 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -19, 0
|
||||
Aged Brie, -27, 50
|
||||
Elixir of the Mongoose, -24, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -14, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -19, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -24, 0
|
||||
Conjured Mana Cake, -26, 0
|
||||
|
||||
-------- day 30 --------
|
||||
name, sellIn, quality
|
||||
+5 Dexterity Vest, -20, 0
|
||||
Aged Brie, -28, 50
|
||||
Elixir of the Mongoose, -25, 0
|
||||
Sulfuras, Hand of Ragnaros, 0, 80
|
||||
Sulfuras, Hand of Ragnaros, -1, 80
|
||||
Backstage passes to a TAFKAL80ETC concert, -15, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -20, 0
|
||||
Backstage passes to a TAFKAL80ETC concert, -25, 0
|
||||
Conjured Mana Cake, -27, 0
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
with Ada.Strings.Unbounded;
|
||||
use Ada.Strings.Unbounded;
|
||||
|
||||
package body Gilded_Rose is
|
||||
procedure Update_Quality(Self : in out Gilded_Rose) is
|
||||
Cursor : Item_Vecs.Cursor := Item_Vecs.First(Self.Items);
|
||||
begin
|
||||
while Item_Vecs.Has_Element(Cursor) loop
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Brie")
|
||||
and Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
|
||||
if Self.Items(Cursor).Quality > 0 then
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality - 1;
|
||||
end if;
|
||||
end if;
|
||||
else
|
||||
if Self.Items(Cursor).Quality < 50 then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
|
||||
|
||||
if Self.Items(Cursor).Name = To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
|
||||
if Self.Items(Cursor).Sell_In < 11 then
|
||||
if Self.Items(Cursor).Quality < 50 then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
if Self.Items(Cursor).Sell_In < 6 then
|
||||
if Self.Items(Cursor).Quality < 50 then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
|
||||
Self.Items(Cursor).Sell_In := Self.Items(Cursor).Sell_In - 1;
|
||||
end if;
|
||||
|
||||
if Self.Items(Cursor).Sell_In < 0 then
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Aged Brie") then
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert") then
|
||||
if Self.Items(Cursor).Quality > 0 then
|
||||
if Self.Items(Cursor).Name /= To_Unbounded_String("Sulfuras, Hand of Ragnaros") then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality - 1;
|
||||
end if;
|
||||
end if;
|
||||
else
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality - Self.Items(Cursor).Quality;
|
||||
end if;
|
||||
else
|
||||
if Self.Items(Cursor).Quality < 50 then
|
||||
Self.Items(Cursor).Quality := Self.Items(Cursor).Quality + 1;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
Item_Vecs.Next(Cursor);
|
||||
end loop;
|
||||
end;
|
||||
|
||||
end Gilded_Rose;
|
||||
@ -1,15 +0,0 @@
|
||||
with Ada.Containers.Vectors;
|
||||
with Items;
|
||||
use Items;
|
||||
|
||||
package Gilded_Rose is
|
||||
package Item_Vecs is new Ada.Containers.Vectors (
|
||||
Element_Type => Item,
|
||||
Index_Type => Positive
|
||||
);
|
||||
|
||||
type Gilded_Rose is record
|
||||
Items : Item_Vecs.Vector;
|
||||
end record;
|
||||
procedure Update_Quality(Self : in out Gilded_Rose);
|
||||
end Gilded_Rose;
|
||||
@ -1,10 +0,0 @@
|
||||
with Ahven.Text_Runner;
|
||||
with Ahven.Framework;
|
||||
with Gilded_Rose_Tests;
|
||||
|
||||
procedure Gilded_Rose_Tester is
|
||||
S : Ahven.Framework.Test_Suite := Ahven.Framework.Create_Suite("All");
|
||||
begin
|
||||
Ahven.Framework.Add_Test(S, new Gilded_Rose_Tests.Test);
|
||||
Ahven.Text_Runner.Run(S);
|
||||
end Gilded_Rose_Tester;
|
||||
@ -1,38 +0,0 @@
|
||||
with Gilded_Rose;
|
||||
use Gilded_Rose;
|
||||
|
||||
with Items;
|
||||
use Items;
|
||||
|
||||
with Ahven;
|
||||
|
||||
with Ada.Strings.Unbounded;
|
||||
|
||||
package body Gilded_Rose_Tests is
|
||||
procedure Initialize(T : in out Test) is
|
||||
begin
|
||||
Set_Name(T, "Gilded_Rose_Test");
|
||||
Ahven.Framework.Add_Test_Routine(T, Test_Gilded_Rose'Access, "Foo");
|
||||
end Initialize;
|
||||
|
||||
procedure Test_Gilded_Rose is
|
||||
Things : Item_Vecs.Vector;
|
||||
begin
|
||||
Things.Append(New_Item =>
|
||||
(Name => SU.To_Unbounded_String("Foo"),
|
||||
Sell_In => 0,
|
||||
Quality => 0));
|
||||
declare
|
||||
App : Gilded_Rose.Gilded_Rose := (Items => Things);
|
||||
|
||||
package SU renames Ada.Strings.Unbounded;
|
||||
procedure Assert_Eq_Unbounded_String is
|
||||
new Ahven.Assert_Equal(Data_Type => SU.Unbounded_String, Image => SU.To_String);
|
||||
begin
|
||||
Update_Quality(App);
|
||||
Assert_Eq_Unbounded_String(Actual => App.Items(Item_Vecs.First(App.Items)).Name,
|
||||
Expected => SU.To_Unbounded_String("fixme"),
|
||||
Message => "fixme");
|
||||
end;
|
||||
end;
|
||||
end Gilded_Rose_Tests;
|
||||
@ -1,11 +0,0 @@
|
||||
with Ahven.Framework;
|
||||
|
||||
package Gilded_Rose_Tests is
|
||||
type Test is new Ahven.Framework.Test_Case with null record;
|
||||
|
||||
procedure Initialize(T : in out Test);
|
||||
|
||||
private
|
||||
|
||||
procedure Test_Gilded_Rose;
|
||||
end Gilded_Rose_Tests;
|
||||
@ -1,31 +0,0 @@
|
||||
with Ada.Strings.Unbounded;
|
||||
use Ada.Strings.Unbounded;
|
||||
|
||||
package body Items is
|
||||
function Integer_Image(Self : in Integer) return String is
|
||||
Img : constant String := Integer'Image(Self);
|
||||
begin
|
||||
if Self < 0 then
|
||||
return Img;
|
||||
else
|
||||
return Img(2 .. Img'Length);
|
||||
end if;
|
||||
end;
|
||||
|
||||
function To_String(Self : in Item) return String is
|
||||
Name : constant Unbounded_String := Self.Name;
|
||||
Sell_In : constant Unbounded_String := To_Unbounded_String(Integer_Image(Self.Sell_In));
|
||||
Quality : constant Unbounded_String := To_Unbounded_String(Integer_Image(Self.Quality));
|
||||
|
||||
Ret : Unbounded_String;
|
||||
begin
|
||||
Append(Ret, Name);
|
||||
Append(Ret, ", ");
|
||||
Append(Ret, Sell_In);
|
||||
Append(Ret, ", ");
|
||||
Append(Ret, Quality);
|
||||
|
||||
return To_String(Ret);
|
||||
end;
|
||||
|
||||
end Items;
|
||||
@ -1,14 +0,0 @@
|
||||
with Ada.Strings.Unbounded;
|
||||
|
||||
package Items is
|
||||
package SU renames Ada.Strings.Unbounded;
|
||||
|
||||
type Item is record
|
||||
Name : SU.Unbounded_String;
|
||||
Sell_In : Integer;
|
||||
Quality : Integer;
|
||||
end record;
|
||||
|
||||
function To_String(Self : in Item) return String;
|
||||
|
||||
end Items;
|
||||
@ -1,72 +0,0 @@
|
||||
with Ada.Text_IO;
|
||||
use Ada.Text_IO;
|
||||
|
||||
with Items;
|
||||
use Items;
|
||||
|
||||
with Ada.Strings.Unbounded;
|
||||
use Ada.Strings.Unbounded;
|
||||
|
||||
with Gilded_Rose;
|
||||
use Gilded_Rose;
|
||||
|
||||
procedure Program is
|
||||
Things : Item_Vecs.Vector;
|
||||
begin
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("+5 Dexterity Vest"),
|
||||
Sell_In => 10,
|
||||
Quality => 20));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Aged Brie"),
|
||||
Sell_In => 2,
|
||||
Quality => 0));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Elixir of the Mongoose"),
|
||||
Sell_In => 5,
|
||||
Quality => 7));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
|
||||
Sell_In => 0,
|
||||
Quality => 80));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Sulfuras, Hand of Ragnaros"),
|
||||
Sell_In => -1,
|
||||
Quality => 80));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 15,
|
||||
Quality => 20));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 10,
|
||||
Quality => 49));
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Backstage passes to a TAFKAL80ETC concert"),
|
||||
Sell_In => 5,
|
||||
Quality => 49));
|
||||
-- this conjured item does not work properly yet
|
||||
Things.Append(New_Item =>
|
||||
(Name => To_Unbounded_String("Conjured Mana Cake"),
|
||||
Sell_In => 3,
|
||||
Quality => 6));
|
||||
|
||||
|
||||
declare
|
||||
App : Gilded_Rose.Gilded_Rose := (Items => Things);
|
||||
begin
|
||||
Put_Line("OMGHAI!");
|
||||
|
||||
for I in 0 .. 30 loop
|
||||
Put_Line("-------- day" & Integer'Image(I) & " --------");
|
||||
Put_Line("name, sellIn, quality");
|
||||
|
||||
for Each of App.Items loop
|
||||
Put_Line(To_String(Each));
|
||||
end loop;
|
||||
Put_Line("");
|
||||
|
||||
Update_Quality(App);
|
||||
end loop;
|
||||
end;
|
||||
end;
|
||||
@ -1,90 +0,0 @@
|
||||
#include <string.h>
|
||||
#include "GildedRose.h"
|
||||
|
||||
Item*
|
||||
init_item(Item* item, const char *name, int sellIn, int quality)
|
||||
{
|
||||
item->sellIn = sellIn;
|
||||
item->quality = quality;
|
||||
item->name = strdup(name);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void update_quality(Item items[], int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
if (strcmp(items[i].name, "Aged Brie") && strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
|
||||
{
|
||||
if (items[i].quality > 0)
|
||||
{
|
||||
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
|
||||
{
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (items[i].quality < 50)
|
||||
{
|
||||
items[i].quality = items[i].quality + 1;
|
||||
|
||||
if (!strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
|
||||
{
|
||||
if (items[i].sellIn < 11)
|
||||
{
|
||||
if (items[i].quality < 50)
|
||||
{
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6)
|
||||
{
|
||||
if (items[i].quality < 50)
|
||||
{
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
|
||||
{
|
||||
items[i].sellIn = items[i].sellIn - 1;
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0)
|
||||
{
|
||||
if (strcmp(items[i].name, "Aged Brie"))
|
||||
{
|
||||
if (strcmp(items[i].name, "Backstage passes to a TAFKAL80ETC concert"))
|
||||
{
|
||||
if (items[i].quality > 0)
|
||||
{
|
||||
if (strcmp(items[i].name, "Sulfuras, Hand of Ragnaros"))
|
||||
{
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
items[i].quality = items[i].quality - items[i].quality;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (items[i].quality < 50)
|
||||
{
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
int sellIn;
|
||||
int quality;
|
||||
} Item;
|
||||
|
||||
extern Item* init_item(Item* item, const char *name, int sellIn, int quality);
|
||||
extern void update_quality(Item items[], int size);
|
||||
@ -1,43 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include "GildedRose.h"
|
||||
|
||||
int
|
||||
print_item(Item *item)
|
||||
{
|
||||
return printf("%s, %d, %d\n", item->name, item->sellIn, item->quality);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
Item items[9];
|
||||
int last = 0;
|
||||
int day;
|
||||
int index;
|
||||
|
||||
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
|
||||
init_item(items + last++, "Aged Brie", 2, 0);
|
||||
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
|
||||
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
|
||||
init_item(items + last++, "Sulfuras, Hand of Ragnaros", -1, 80);
|
||||
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
|
||||
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 10, 49);
|
||||
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 5, 49);
|
||||
// this Conjured item doesn't yet work properly
|
||||
init_item(items + last++, "Conjured Mana Cake", 3, 6);
|
||||
|
||||
puts("OMGHAI!");
|
||||
|
||||
for (day = 0; day <= 30; day++)
|
||||
{
|
||||
printf("-------- day %d --------\n", day);
|
||||
printf("name, sellIn, quality\n");
|
||||
for(index = 0; index < last; index++) {
|
||||
print_item(items + index);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
update_quality(items, last);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
#include <CppUTest/TestHarness.h>
|
||||
#include <CppUTest/CommandLineTestRunner.h>
|
||||
#include <CppUTestExt/MockSupport.h>
|
||||
|
||||
extern "C" {
|
||||
#include "GildedRose.h"
|
||||
}
|
||||
|
||||
TEST_GROUP(TestGildedRoseGroup)
|
||||
{
|
||||
void setup() {
|
||||
}
|
||||
void teardown() {
|
||||
}
|
||||
};
|
||||
|
||||
TEST(TestGildedRoseGroup, FirstTest)
|
||||
{
|
||||
Item items[2];
|
||||
init_item(items, "Foo", 0, 0);
|
||||
update_quality(items, 1);
|
||||
STRCMP_EQUAL("fixme", items[0].name);
|
||||
}
|
||||
|
||||
void example()
|
||||
{
|
||||
Item items[6];
|
||||
int last = 0;
|
||||
|
||||
init_item(items + last++, "+5 Dexterity Vest", 10, 20);
|
||||
init_item(items + last++, "Aged Brie", 2, 0);
|
||||
init_item(items + last++, "Elixir of the Mongoose", 5, 7);
|
||||
init_item(items + last++, "Sulfuras, Hand of Ragnaros", 0, 80);
|
||||
init_item(items + last++, "Backstage passes to a TAFKAL80ETC concert", 15, 20);
|
||||
init_item(items + last++, "Conjured Mana Cake", 3, 6);
|
||||
update_quality(items, last);
|
||||
}
|
||||
|
||||
int
|
||||
main(int ac, char** av)
|
||||
{
|
||||
return CommandLineTestRunner::RunAllTests(ac, av);
|
||||
}
|
||||
51
C/Makefile
51
C/Makefile
@ -1,51 +0,0 @@
|
||||
# Makefile for building the kata file with the Google Testing Framework
|
||||
#
|
||||
# SYNOPSIS:
|
||||
#
|
||||
# make [all] - makes everything.
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
# Please tweak the following variable definitions as needed by your
|
||||
# project.
|
||||
|
||||
# Points to the root of CppUTest, relative to where this file is.
|
||||
# Remember to tweak this if you move this file.
|
||||
CPPUTEST_HOME = CppUTest
|
||||
|
||||
# Where to find user code.
|
||||
USER_DIR = .
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
CPPFLAGS += -I$(CPPUTEST_HOME)/include
|
||||
|
||||
# Flags passed to the C++ compiler.
|
||||
CFLAGS += -g -Wall -Wextra
|
||||
|
||||
LD_LIBRARIES = -L$(CPPUTEST_HOME)/lib -lCppUTest
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
# created to the list.
|
||||
TESTS = GildedRoseUnitTests
|
||||
|
||||
TEXTTESTS = GildedRoseTextTests
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
all : $(TESTS) $(TEXTTESTS)
|
||||
|
||||
GildedRose.o : $(USER_DIR)/GildedRose.c
|
||||
|
||||
GildedRoseUnitTests : $(USER_DIR)/GildedRoseUnitTests.cc GildedRose.o
|
||||
$(CXX) $(CPPFLAGS) $(CFLAGS) -o $@ $(USER_DIR)/GildedRoseUnitTests.cc GildedRose.o $(LD_LIBRARIES)
|
||||
|
||||
GildedRoseTextTests.o : $(USER_DIR)/GildedRoseTextTests.c
|
||||
|
||||
GildedRoseTextTests : GildedRoseTextTests.o GildedRose.o
|
||||
$(CC) $^ -o $@
|
||||
|
||||
clean :
|
||||
rm -f $(TESTS) $(TEXTTESTS) *.o *~
|
||||
|
||||
check-syntax:
|
||||
gcc $(CPPFLAGS) -o /dev/null -S ${CHK_SOURCES}
|
||||
@ -1,5 +0,0 @@
|
||||
run-once.sh runs your tests once
|
||||
|
||||
Assumptions:
|
||||
- make and a C++ compiler (like gcc) is installed on your system and is in the PATH
|
||||
- The CppUTest framework is in the directory CppUTest
|
||||
@ -1,2 +0,0 @@
|
||||
make
|
||||
./GildedRoseTextTests
|
||||
@ -1,169 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cobolProject" name="Gilded Rose" uuid="3529a385-3bb5-4b82-9b84-9e384fb2bdd4" version="4.0">
|
||||
<settings xsi:type="projectSettingsContainer">
|
||||
<copybook-paths xsi:type="copybookPathsSettings">
|
||||
<path enabled="true" name="/Gilded Rose" type="mfpath"/>
|
||||
</copybook-paths>
|
||||
<build-precedence-paths xsi:type="buildPrecedenceSettings">
|
||||
<path enabled="true" name="/Gilded Rose" type="mfpath"/>
|
||||
</build-precedence-paths>
|
||||
<configurations default="Gilded Rose" linkedWith="2017" xsi:type="buildConfigurationsContainer">
|
||||
<configuration description="Gilded Rose" type="all_intgnt" is64bit="false" createlbr="false" platform="Windows" xsi:type="cobolBuildConfiguration">
|
||||
<targetdir name="Gilded Rose.bin"/>
|
||||
<application_configuration xsi:type="runtimeConfigurationSettings">
|
||||
<cobol_switches xsi:type="projectCobolSwitches"/>
|
||||
<rts_switches xsi:type="projectRtsSwitches"/>
|
||||
<envScriptParameters></envScriptParameters>
|
||||
<envScriptPath></envScriptPath>
|
||||
<inheritBuildEnv>false</inheritBuildEnv>
|
||||
<tunables>
|
||||
<tunable index="0" name="screen_lines" value="25"/>
|
||||
<tunable index="0" name="screen_cols" value="80"/>
|
||||
<tunable index="0" name="default_cancel_mode" value="1"/>
|
||||
<tunable index="0" name="program_search_order" value="4"/>
|
||||
<tunable index="0" name="arguments_are_initial" value="false"/>
|
||||
<tunable index="0" name="command_line_accept" value="false"/>
|
||||
<tunable index="0" name="sort_memory" value="0"/>
|
||||
<tunable index="0" name="dynamic_memory_limit" value="2147483647"/>
|
||||
<tunable index="0" name="memory_free_check_size" value="100"/>
|
||||
<tunable index="0" name="memory_strategy" value="1"/>
|
||||
<tunable index="0" name="ansi_input_mode" value="false"/>
|
||||
<tunable index="0" name="current_year" value="0"/>
|
||||
<tunable index="0" name="current_month" value="0"/>
|
||||
<tunable index="0" name="current_day" value="0"/>
|
||||
<tunable index="0" name="datewarp_dynamic" value="false"/>
|
||||
<tunable index="0" name="current_hour" value="-1"/>
|
||||
<tunable index="0" name="current_minute" value="-1"/>
|
||||
<tunable index="0" name="current_second" value="-1"/>
|
||||
<tunable index="0" name="timewarp_dynamic" value="false"/>
|
||||
</tunables>
|
||||
</application_configuration>
|
||||
<link_settings xsi:type="linkSettings">
|
||||
<additional_options value=""/>
|
||||
<rts_bind value="false"/>
|
||||
<custom_link_command value=""/>
|
||||
<debug value="false"/>
|
||||
<entry_point name=""/>
|
||||
<entry_point_runtime value="false"/>
|
||||
<error_undefined_syms value="false"/>
|
||||
<application_type value="console"/>
|
||||
<include_cpp value="false"/>
|
||||
<additional_files/>
|
||||
<rcfile path=""/>
|
||||
<rts_type value="shared"/>
|
||||
<target name="Gilded Rose"/>
|
||||
<targettype type="exe"/>
|
||||
<threaded_rts value="true"/>
|
||||
<verbose value="false"/>
|
||||
</link_settings>
|
||||
</configuration>
|
||||
</configurations>
|
||||
<cobol_settings xsi:type="cobolSettings">
|
||||
<options>
|
||||
<option name="WARNING" value="1"/>
|
||||
<option name="DIALECT" value="MF"/>
|
||||
<option name="CHARSET" value="ASCII"/>
|
||||
<option name="SOURCEFORMAT" value="free"/>
|
||||
<option name="MAX-ERROR" value="100"/>
|
||||
</options>
|
||||
<createJar value="false"/>
|
||||
<createJarAfterBuild value="false"/>
|
||||
<debug value="true"/>
|
||||
<enableCodeCoverage value="true"/>
|
||||
<enableProfiler value="false"/>
|
||||
<generate value="false"/>
|
||||
<retainDirectivesFile value="false"/>
|
||||
<genListFile value="false"/>
|
||||
<packageToFolderMapping value="false"/>
|
||||
<useJvmDynamicCalls value="false"/>
|
||||
<useJvmIncrementalBuild value="false"/>
|
||||
<verbose value="false"/>
|
||||
</cobol_settings>
|
||||
<ims_settings xsi:type="additionalImsSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<generatedFileDir name=""/>
|
||||
<imsDatabaseDir name=""/>
|
||||
</ims_settings>
|
||||
<mfs_settings xsi:type="mfsSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/MFS/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
</mfs_settings>
|
||||
<dbd_settings xsi:type="dbdSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/DBD/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<cleanDbdOutputFiles value="false"/>
|
||||
</dbd_settings>
|
||||
<psb_settings xsi:type="psbSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/PSB/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<cleanPsbOutputFiles value="false"/>
|
||||
</psb_settings>
|
||||
<bms_settings xsi:type="bmsSettings">
|
||||
<options>
|
||||
<option id="dsect" name="bmsSettings" value="/SYSPARM=DSECT"/>
|
||||
<option id="decimalchar" name="bmsSettings" value="/DP=."/>
|
||||
<option id="currencychar" name="bmsSettings" value="/CS=$"/>
|
||||
<option id="sdf" name="bmsSettings" value="/IGNORE"/>
|
||||
<option id="map" name="bmsSettings" value="/SYSPARM=MAP"/>
|
||||
</options>
|
||||
</bms_settings>
|
||||
<dependent-projects xsi:type="dependentProjectsSettings"/>
|
||||
<asm_settings xsi:type="assemblerCompileSettings">
|
||||
<options>
|
||||
<option id="compile_pre_assm_macros" name="mf370chk" value="NOMPC"/>
|
||||
<option id="compile_mark_reentrant" name="mf370chk" value="RENT"/>
|
||||
<option id="compile_create_optimized_code" name="mf370chk" value="NOOPT"/>
|
||||
<option id="compile_aat_info" name="mf370chk" value="NOAAT"/>
|
||||
<option id="compile_cross_ref_listing" name="mf370chk" value="NOXREF"/>
|
||||
<option id="compile_create_debug_info" name="mf370chk" value="ANIM"/>
|
||||
<option id="compile_generate_listing" name="mf370chk" value="NOLIST"/>
|
||||
</options>
|
||||
</asm_settings>
|
||||
<asm_link_settings xsi:type="assemblerLinkSettings">
|
||||
<options>
|
||||
<option id="link_residency_mode" name="mf370lnk" value="RMODE(31)"/>
|
||||
<option id="link_linker_output" name="mf370lnk" value="OMF(390)"/>
|
||||
<option id="link_resolve_external" name="mf370lnk" value="CALL"/>
|
||||
<option id="link_mark_reusable" name="mf370lnk" value="REUS"/>
|
||||
<option id="link_generate_listing" name="mf370lnk" value="NOLIST"/>
|
||||
<option id="link_create_debug_info" name="mf370lnk" value="ANIM"/>
|
||||
<option id="link_mark_reentrant" name="mf370lnk" value="RENT"/>
|
||||
<option id="link_addressing_mode" name="mf370lnk" value="AMODE(31)"/>
|
||||
</options>
|
||||
</asm_link_settings>
|
||||
<asm_cics_settings enabled="false" xsi:type="assemblerCicsSettings">
|
||||
<options>
|
||||
<option id="cics_insert_epilog_macros" name="mf370chkCics" value="EPILOG"/>
|
||||
<option id="cics_unsupported_option" name="mf370chkCics" value="UOPT(E)"/>
|
||||
<option id="cics_insert_prolog_macros" name="mf370chkCics" value="PROLOG"/>
|
||||
<option id="cics_unsupported_function" name="mf370chkCics" value="UFUNC(E)"/>
|
||||
</options>
|
||||
</asm_cics_settings>
|
||||
<asm_autolink_settings enabled="true" xsi:type="assemblerAutoLinkSettings">
|
||||
<options>
|
||||
<option id="autolink_residency_mode" name="mf370chkAutoLink" value="RMODE(31)"/>
|
||||
<option id="autolink_mark_reusable" name="mf370chkAutoLink" value="REUS"/>
|
||||
<option id="autolink_resolve_external" name="mf370chkAutoLink" value="CALL"/>
|
||||
<option id="autolink_linker_output" name="mf370chkAutoLink" value="OMF(390)"/>
|
||||
<option id="autolink_addressing_mode" name="mf370chkAutoLink" value="AMODE(31)"/>
|
||||
</options>
|
||||
</asm_autolink_settings>
|
||||
<preprocessors_settings xsi:type="preprocessorsSettings"/>
|
||||
<code_analysis_settings enabled="false" genDataFiles="false" keepDataFiles="false" xsi:type="codeAnalysisSettings"/>
|
||||
</settings>
|
||||
<files xsi:type="projectFileStore">
|
||||
<filetype type="cobol" xsi:type="cobolFileContainer">
|
||||
<file compile="true" path="GildedRose.cbl" xsi:type="cobolFile"/>
|
||||
</filetype>
|
||||
<filetype type="cobol.copybook" xsi:type="cobolFileContainer"/>
|
||||
</files>
|
||||
</project>
|
||||
2
COBOL/mf/src/.gitignore
vendored
2
COBOL/mf/src/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
.cobolBuild
|
||||
/Gilded_Rose.bin/
|
||||
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Gilded Rose</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.microfocus.eclipse.project.cobolBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.microfocus.eclipse.project.cobolNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -1,72 +0,0 @@
|
||||
program-id. GildedRose as "GildedRose".
|
||||
|
||||
file-control.
|
||||
select in-items assign 'in-items'.
|
||||
select items assign 'items'.
|
||||
|
||||
data division.
|
||||
file section.
|
||||
fd in-items.
|
||||
01 in-item pic x(58).
|
||||
fd items.
|
||||
01 item.
|
||||
02 sell-in pic 9(4).
|
||||
02 quality pic 9(4).
|
||||
02 name pic x(50).
|
||||
|
||||
working-storage section.
|
||||
procedure division.
|
||||
open input in-items output items.
|
||||
start-lable.
|
||||
read in-items end go to end-lable.
|
||||
move in-item to item.
|
||||
if name not equal "Aged Brie" and name not equal "Backstage passes to a TAFKAL80ETC concert"
|
||||
if quality greater then 0
|
||||
if name not equal to "Sulfuras, Hand of Ragnaros"
|
||||
compute quality = quality - 1
|
||||
end-if
|
||||
end-if
|
||||
else
|
||||
if quality is less then 50
|
||||
compute quality = quality + 1
|
||||
if name equals "Backstage passes to a TAFKAL80ETC concert"
|
||||
if sell-in less then 11
|
||||
if quality less then 50
|
||||
compute quality = quality + 1
|
||||
end-if
|
||||
end-if
|
||||
if sell-in less then 6
|
||||
if quality less then 50
|
||||
compute quality = quality + 1
|
||||
end-if
|
||||
end-if
|
||||
end-if
|
||||
end-if
|
||||
end-if
|
||||
if name not equal "Sulfuras, Hand of Ragnaros"
|
||||
compute sell-in = sell-in - 1
|
||||
end-if
|
||||
if sell-in is less then 0
|
||||
if name is not equal to "Aged Brie"
|
||||
if name is not equal to "Backstage passes to a TAFKAL80ETC concert"
|
||||
if quality is greater then 0
|
||||
if name is equal to "Sulfuras, Hand of Ragnaros"
|
||||
compute quality = quality - 1
|
||||
end-if
|
||||
end-if
|
||||
else
|
||||
compute quality = quality - quality
|
||||
end-if
|
||||
else
|
||||
if quality is less then 50
|
||||
compute quality = quality + 1
|
||||
end-if
|
||||
end-if
|
||||
end-if
|
||||
write item.
|
||||
go to start-lable.
|
||||
end-lable.
|
||||
close items.
|
||||
goback.
|
||||
|
||||
end program GildedRose.
|
||||
@ -1,157 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="cobolProject" name="Tests" uuid="d5f7cafb-a22e-4fe6-9bb2-1f9a673a4e7d" version="4.0">
|
||||
<settings xsi:type="projectSettingsContainer">
|
||||
<cobol_settings xsi:type="cobolSettings">
|
||||
<options>
|
||||
<option name="WARNING" value="1"/>
|
||||
<option name="DIALECT" value="MF"/>
|
||||
<option name="CHARSET" value="ASCII"/>
|
||||
<option name="MAX-ERROR" value="100"/>
|
||||
<option name="SOURCEFORMAT" value="variable"/>
|
||||
</options>
|
||||
<createJar value="false"/>
|
||||
<createJarAfterBuild value="false"/>
|
||||
<debug value="true"/>
|
||||
<enableCodeCoverage value="true"/>
|
||||
<enableProfiler value="false"/>
|
||||
<generate value="false"/>
|
||||
<retainDirectivesFile value="false"/>
|
||||
<genListFile value="false"/>
|
||||
<packageToFolderMapping value="false"/>
|
||||
<useJvmDynamicCalls value="false"/>
|
||||
<useJvmIncrementalBuild value="false"/>
|
||||
<verbose value="false"/>
|
||||
</cobol_settings>
|
||||
<copybook-paths xsi:type="copybookPathsSettings">
|
||||
<path enabled="true" name="/Tests" type="mfpath"/>
|
||||
<path enabled="true" name="/Gilded Rose" type="mfpath"/>
|
||||
<path enabled="false" name="/Tests/Coverage" type="mfpath"/>
|
||||
</copybook-paths>
|
||||
<build-precedence-paths xsi:type="buildPrecedenceSettings">
|
||||
<path enabled="true" name="/Tests" type="mfpath"/>
|
||||
<path enabled="true" name="/Tests/Coverage" type="mfpath"/>
|
||||
</build-precedence-paths>
|
||||
<configurations default="Tests" linkedWith="2017" xsi:type="buildConfigurationsContainer">
|
||||
<configuration description="Tests" type="single_dll" is64bit="false" createlbr="false" platform="Windows" xsi:type="cobolBuildConfiguration">
|
||||
<targetdir name="Tests.bin"/>
|
||||
<application_configuration xsi:type="runtimeConfigurationSettings">
|
||||
<cobol_switches xsi:type="projectCobolSwitches"/>
|
||||
<rts_switches xsi:type="projectRtsSwitches"/>
|
||||
<envScriptParameters></envScriptParameters>
|
||||
<envScriptPath></envScriptPath>
|
||||
<inheritBuildEnv>false</inheritBuildEnv>
|
||||
<tunables>
|
||||
<tunable index="0" name="screen_lines" value="25"/>
|
||||
<tunable index="0" name="screen_cols" value="80"/>
|
||||
</tunables>
|
||||
</application_configuration>
|
||||
<link_settings xsi:type="linkSettings">
|
||||
<additional_options value=""/>
|
||||
<rts_bind value="false"/>
|
||||
<custom_link_command value=""/>
|
||||
<debug value="false"/>
|
||||
<entry_point name=""/>
|
||||
<entry_point_runtime value="false"/>
|
||||
<error_undefined_syms value="false"/>
|
||||
<application_type value="console"/>
|
||||
<include_cpp value="false"/>
|
||||
<additional_files/>
|
||||
<rcfile path=""/>
|
||||
<rts_type value="shared"/>
|
||||
<target name="Tests"/>
|
||||
<targettype type="dll/cso"/>
|
||||
<threaded_rts value="true"/>
|
||||
<verbose value="false"/>
|
||||
</link_settings>
|
||||
</configuration>
|
||||
</configurations>
|
||||
<ims_settings xsi:type="additionalImsSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<generatedFileDir name=""/>
|
||||
<imsDatabaseDir name=""/>
|
||||
</ims_settings>
|
||||
<mfs_settings xsi:type="mfsSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/MFS/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
</mfs_settings>
|
||||
<dbd_settings xsi:type="dbdSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/DBD/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<cleanDbdOutputFiles value="false"/>
|
||||
</dbd_settings>
|
||||
<psb_settings xsi:type="psbSettings">
|
||||
<options>
|
||||
<option id="generate_list_file" name="LIST" value="Listing/PSB/*.lst"/>
|
||||
</options>
|
||||
<verbose value="false"/>
|
||||
<cleanPsbOutputFiles value="false"/>
|
||||
</psb_settings>
|
||||
<bms_settings xsi:type="bmsSettings">
|
||||
<options>
|
||||
<option id="dsect" name="bmsSettings" value="/SYSPARM=DSECT"/>
|
||||
<option id="decimalchar" name="bmsSettings" value="/DP=."/>
|
||||
<option id="currencychar" name="bmsSettings" value="/CS=$"/>
|
||||
<option id="sdf" name="bmsSettings" value="/IGNORE"/>
|
||||
<option id="map" name="bmsSettings" value="/SYSPARM=MAP"/>
|
||||
</options>
|
||||
</bms_settings>
|
||||
<dependent-projects xsi:type="dependentProjectsSettings">
|
||||
<dependent-project name="Gilded Rose"/>
|
||||
</dependent-projects>
|
||||
<asm_settings xsi:type="assemblerCompileSettings">
|
||||
<options>
|
||||
<option id="compile_pre_assm_macros" name="mf370chk" value="NOMPC"/>
|
||||
<option id="compile_mark_reentrant" name="mf370chk" value="RENT"/>
|
||||
<option id="compile_create_optimized_code" name="mf370chk" value="NOOPT"/>
|
||||
<option id="compile_aat_info" name="mf370chk" value="NOAAT"/>
|
||||
<option id="compile_cross_ref_listing" name="mf370chk" value="NOXREF"/>
|
||||
<option id="compile_create_debug_info" name="mf370chk" value="ANIM"/>
|
||||
<option id="compile_generate_listing" name="mf370chk" value="NOLIST"/>
|
||||
</options>
|
||||
</asm_settings>
|
||||
<asm_link_settings xsi:type="assemblerLinkSettings">
|
||||
<options>
|
||||
<option id="link_residency_mode" name="mf370lnk" value="RMODE(31)"/>
|
||||
<option id="link_linker_output" name="mf370lnk" value="OMF(390)"/>
|
||||
<option id="link_resolve_external" name="mf370lnk" value="CALL"/>
|
||||
<option id="link_mark_reusable" name="mf370lnk" value="REUS"/>
|
||||
<option id="link_generate_listing" name="mf370lnk" value="NOLIST"/>
|
||||
<option id="link_create_debug_info" name="mf370lnk" value="ANIM"/>
|
||||
<option id="link_mark_reentrant" name="mf370lnk" value="RENT"/>
|
||||
<option id="link_addressing_mode" name="mf370lnk" value="AMODE(31)"/>
|
||||
</options>
|
||||
</asm_link_settings>
|
||||
<asm_cics_settings enabled="false" xsi:type="assemblerCicsSettings">
|
||||
<options>
|
||||
<option id="cics_insert_epilog_macros" name="mf370chkCics" value="EPILOG"/>
|
||||
<option id="cics_unsupported_option" name="mf370chkCics" value="UOPT(E)"/>
|
||||
<option id="cics_insert_prolog_macros" name="mf370chkCics" value="PROLOG"/>
|
||||
<option id="cics_unsupported_function" name="mf370chkCics" value="UFUNC(E)"/>
|
||||
</options>
|
||||
</asm_cics_settings>
|
||||
<asm_autolink_settings enabled="true" xsi:type="assemblerAutoLinkSettings">
|
||||
<options>
|
||||
<option id="autolink_residency_mode" name="mf370chkAutoLink" value="RMODE(31)"/>
|
||||
<option id="autolink_mark_reusable" name="mf370chkAutoLink" value="REUS"/>
|
||||
<option id="autolink_resolve_external" name="mf370chkAutoLink" value="CALL"/>
|
||||
<option id="autolink_linker_output" name="mf370chkAutoLink" value="OMF(390)"/>
|
||||
<option id="autolink_addressing_mode" name="mf370chkAutoLink" value="AMODE(31)"/>
|
||||
</options>
|
||||
</asm_autolink_settings>
|
||||
<preprocessors_settings xsi:type="preprocessorsSettings"/>
|
||||
<code_analysis_settings enabled="false" genDataFiles="false" keepDataFiles="false" xsi:type="codeAnalysisSettings"/>
|
||||
</settings>
|
||||
<files xsi:type="projectFileStore">
|
||||
<filetype type="cobol" xsi:type="cobolFileContainer">
|
||||
<file compile="true" path="TestGildedRose.cbl" xsi:type="cobolFile"/>
|
||||
</filetype>
|
||||
<filetype type="cobol.copybook" xsi:type="cobolFileContainer"/>
|
||||
</files>
|
||||
</project>
|
||||
3
COBOL/mf/test/.gitignore
vendored
3
COBOL/mf/test/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
/.cobolBuild
|
||||
/Coverage/
|
||||
/Tests.bin/
|
||||
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.microfocus.eclipse.project.cobolBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.microfocus.eclipse.mfunit.core.mfUnitBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.microfocus.eclipse.project.cobolNature</nature>
|
||||
<nature>com.microfocus.eclipse.mfunit.core.mfUnitNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -1,67 +0,0 @@
|
||||
*> Test Fixture for GildedRose, GildedRose
|
||||
|
||||
copy "mfunit_prototypes.cpy".
|
||||
|
||||
program-id. TestGildedRose.
|
||||
|
||||
file-control.
|
||||
select in-items assign 'in-items'.
|
||||
select items assign 'items'.
|
||||
|
||||
file section.
|
||||
fd in-items.
|
||||
01 in-item.
|
||||
02 sell-in pic 9(4).
|
||||
02 quality pic 9(4).
|
||||
02 name pic x(50).
|
||||
fd items.
|
||||
01 item.
|
||||
02 sell-in pic 9(4).
|
||||
02 quality pic 9(4).
|
||||
02 name pic x(50).
|
||||
|
||||
working-storage section.
|
||||
copy "mfunit.cpy".
|
||||
78 TEST-TESTGILDEDROSE value "TestGildedRose".
|
||||
01 pp procedure-pointer.
|
||||
|
||||
*> Program linkage data
|
||||
|
||||
procedure division.
|
||||
goback returning 0
|
||||
.
|
||||
|
||||
entry MFU-TC-PREFIX & TEST-TESTGILDEDROSE.
|
||||
open output in-items
|
||||
move "foo" to name in in-item
|
||||
move 0 to quality in in-item
|
||||
move 0 to sell-in in in-item
|
||||
write in-item
|
||||
close in-items
|
||||
call "GildedRose"
|
||||
open input items
|
||||
read items
|
||||
if name in item not equal to "fixme" then
|
||||
call MFU-ASSERT-FAIL-Z using z"item name was not fixme"
|
||||
close items
|
||||
goback
|
||||
.
|
||||
|
||||
$region TestCase Configuration
|
||||
|
||||
entry MFU-TC-SETUP-PREFIX & TEST-TESTGILDEDROSE.
|
||||
perform InitializeLinkageData
|
||||
*> Add any other test setup code here
|
||||
goback returning 0
|
||||
.
|
||||
|
||||
InitializeLinkageData section.
|
||||
*> Load the library that is being tested
|
||||
set pp to entry "GildedRose"
|
||||
|
||||
exit section
|
||||
.
|
||||
|
||||
$end-region
|
||||
|
||||
end program.
|
||||
17
Delphi/.gitattributes
vendored
17
Delphi/.gitattributes
vendored
@ -1,17 +0,0 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files you want to always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.groupproj text
|
||||
*.dpr text
|
||||
*.dproj text
|
||||
*.pas text
|
||||
*.dfm text
|
||||
*.fmx text
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.exe binary
|
||||
*.res binary
|
||||
71
Delphi/.gitignore
vendored
71
Delphi/.gitignore
vendored
@ -1,71 +0,0 @@
|
||||
# Uncomment these types if you want even more clean repository. But be careful.
|
||||
# It can make harm to an existing project source. Read explanations below.
|
||||
#
|
||||
# Resource files are binaries containing manifest, project icon and version info.
|
||||
# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
|
||||
*.res
|
||||
#
|
||||
# Type library file (binary). In old Delphi versions it should be stored.
|
||||
# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
|
||||
#*.tlb
|
||||
#
|
||||
# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
|
||||
# Uncomment this if you are not using diagrams or use newer Delphi version.
|
||||
#*.ddp
|
||||
#
|
||||
# Visual LiveBindings file. Added in Delphi XE2.
|
||||
# Uncomment this if you are not using LiveBindings Designer.
|
||||
#*.vlb
|
||||
#
|
||||
# Deployment Manager configuration file for your project. Added in Delphi XE2.
|
||||
# Uncomment this if it is not mobile development and you do not use remote debug feature.
|
||||
#*.deployproj
|
||||
#
|
||||
# C++ object files produced when C/C++ Output file generation is configured.
|
||||
# Uncomment this if you are not using external objects (zlib library for example).
|
||||
#*.obj
|
||||
#
|
||||
|
||||
# Delphi compiler-generated binaries (safe to delete)
|
||||
*.exe
|
||||
*.dll
|
||||
*.bpl
|
||||
*.bpi
|
||||
*.dcp
|
||||
*.so
|
||||
*.apk
|
||||
*.drc
|
||||
*.map
|
||||
*.dres
|
||||
*.rsm
|
||||
*.tds
|
||||
*.dcu
|
||||
*.lib
|
||||
*.a
|
||||
*.o
|
||||
*.ocx
|
||||
|
||||
# Delphi autogenerated files (duplicated info)
|
||||
*.cfg
|
||||
*.hpp
|
||||
*Resource.rc
|
||||
|
||||
# Delphi local files (user-specific info)
|
||||
*.local
|
||||
*.identcache
|
||||
*.projdata
|
||||
*.tvsconfig
|
||||
*.dsk
|
||||
|
||||
# Delphi history and backups
|
||||
__history/
|
||||
__recovery/
|
||||
*.~*
|
||||
|
||||
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
|
||||
*.stat
|
||||
|
||||
# Ignore Build outputs
|
||||
Build
|
||||
Win32
|
||||
Win64
|
||||
@ -1,48 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{3E0B3749-4258-486E-A44B-05088E7E42D6}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Projects Include="TextTestFixture.dproj">
|
||||
<Dependencies/>
|
||||
</Projects>
|
||||
<Projects Include="UnitTests.dproj">
|
||||
<Dependencies/>
|
||||
</Projects>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Default.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType/>
|
||||
<BorlandProject>
|
||||
<Default.Personality/>
|
||||
</BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<Target Name="TextTestFixture">
|
||||
<MSBuild Projects="TextTestFixture.dproj"/>
|
||||
</Target>
|
||||
<Target Name="TextTestFixture:Clean">
|
||||
<MSBuild Projects="TextTestFixture.dproj" Targets="Clean"/>
|
||||
</Target>
|
||||
<Target Name="TextTestFixture:Make">
|
||||
<MSBuild Projects="TextTestFixture.dproj" Targets="Make"/>
|
||||
</Target>
|
||||
<Target Name="UnitTests">
|
||||
<MSBuild Projects="UnitTests.dproj"/>
|
||||
</Target>
|
||||
<Target Name="UnitTests:Clean">
|
||||
<MSBuild Projects="UnitTests.dproj" Targets="Clean"/>
|
||||
</Target>
|
||||
<Target Name="UnitTests:Make">
|
||||
<MSBuild Projects="UnitTests.dproj" Targets="Make"/>
|
||||
</Target>
|
||||
<Target Name="Build">
|
||||
<CallTarget Targets="TextTestFixture;UnitTests"/>
|
||||
</Target>
|
||||
<Target Name="Clean">
|
||||
<CallTarget Targets="TextTestFixture:Clean;UnitTests:Clean"/>
|
||||
</Target>
|
||||
<Target Name="Make">
|
||||
<CallTarget Targets="TextTestFixture:Make;UnitTests:Make"/>
|
||||
</Target>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
|
||||
</Project>
|
||||
@ -1,106 +0,0 @@
|
||||
unit GildedRose;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Item,
|
||||
System.Generics.Collections;
|
||||
|
||||
type
|
||||
TGildedRose = class(TObject)
|
||||
private
|
||||
FItems: TObjectList<TItem>;
|
||||
public
|
||||
constructor Create(const AItems: TObjectList<TItem>);
|
||||
procedure UpdateQuality;
|
||||
property Items: TObjectList<TItem> read FItems;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TGildedRose }
|
||||
|
||||
constructor TGildedRose.Create(const AItems: TObjectList<TItem>);
|
||||
begin
|
||||
inherited Create;
|
||||
FItems := AItems;
|
||||
end;
|
||||
|
||||
procedure TGildedRose.UpdateQuality;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
for I := 0 to Items.Count - 1 do
|
||||
begin
|
||||
if (Items[I].Name <> 'Aged Brie') and (Items[I].Name <> 'Backstage passes to a TAFKAL80ETC concert') then
|
||||
begin
|
||||
if Items[I].Quality > 0 then
|
||||
begin
|
||||
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality - 1;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Items[I].Quality < 50 then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality + 1;
|
||||
if Items[I].Name = 'Backstage passes to a TAFKAL80ETC concert' then
|
||||
begin
|
||||
if Items[I].SellIn < 11 then
|
||||
begin
|
||||
if Items[I].Quality < 50 then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality + 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Items[I].SellIn < 6 then
|
||||
begin
|
||||
if Items[I].Quality < 50 then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality + 1;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
|
||||
begin
|
||||
Items[I].SellIn := Items[I].SellIn - 1;
|
||||
end;
|
||||
|
||||
if Items[I].SellIn < 0 then
|
||||
begin
|
||||
if Items[I].Name <> 'Aged Brie' then
|
||||
begin
|
||||
if Items[I].Name <> 'Backstage passes to a TAFKAL80ETC concert' then
|
||||
begin
|
||||
if Items[I].Quality > 0 then
|
||||
begin
|
||||
if Items[I].Name <> 'Sulfuras, Hand of Ragnaros' then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality - 1;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality - Items[I].Quality;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Items[I].Quality < 50 then
|
||||
begin
|
||||
Items[I].Quality := Items[I].Quality + 1;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -1,36 +0,0 @@
|
||||
unit GildedRoseTests;
|
||||
|
||||
interface
|
||||
uses
|
||||
DUnitX.TestFramework,
|
||||
GildedRose,
|
||||
Item,
|
||||
System.Generics.Collections;
|
||||
|
||||
type
|
||||
[TestFixture]
|
||||
TGildedRoseTests = class(TObject)
|
||||
public
|
||||
[Test]
|
||||
procedure UpdateQuality_Never_ChangesTheItemName;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TGildedRoseTests.UpdateQuality_Never_ChangesTheItemName;
|
||||
var
|
||||
LItems: TObjectList<TItem>;
|
||||
LGildedRose: TGildedRose;
|
||||
begin
|
||||
LItems := TObjectList<TItem>.Create;
|
||||
LItems.Add(TItem.Create('foo', 0, 0));
|
||||
LGildedRose := TGildedRose.Create(LItems);
|
||||
|
||||
LGildedRose.UpdateQuality;
|
||||
|
||||
Assert.AreEqual('fixme', LGildedRose.Items[0].Name);
|
||||
end;
|
||||
|
||||
initialization
|
||||
TDUnitX.RegisterTestFixture(TGildedRoseTests);
|
||||
end.
|
||||
@ -1,39 +0,0 @@
|
||||
unit Item;
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TItem = class(TObject)
|
||||
private
|
||||
FName: string;
|
||||
FSellIn: Integer;
|
||||
FQuality: Integer;
|
||||
public
|
||||
constructor Create(const AName: string; const ASellIn, AQuality: Integer);
|
||||
function ToString: string; override;
|
||||
property Name: string read FName write FName;
|
||||
property SellIn: Integer read FSellIn write FSellIn;
|
||||
property Quality: Integer read FQuality write FQuality;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
System.SysUtils;
|
||||
|
||||
{ TItem }
|
||||
|
||||
constructor TItem.Create(const AName: string; const ASellIn, AQuality: Integer);
|
||||
begin
|
||||
inherited Create;
|
||||
FName := AName;
|
||||
FSellIn := ASellIn;
|
||||
FQuality := AQuality;
|
||||
end;
|
||||
|
||||
function TItem.ToString: string;
|
||||
begin
|
||||
Result := Format('%s, %d, %d', [Name, SellIn, Quality]);
|
||||
end;
|
||||
|
||||
end.
|
||||
@ -1,13 +0,0 @@
|
||||
# Delphi port of the Gilded-Rose Kata
|
||||
This is a Delphi port of the *Gilded-Rose-Kata*.
|
||||
|
||||
## Version Compatibility
|
||||
The project files are written in Delphi 10.3.3 therefore require 10.3 or later.
|
||||
That said, the actual code should be compatible back to Delphi 2010 as the unit
|
||||
tests are written in [DUnitX](https://github.com/VSoftTechnologies/DUnitX) which
|
||||
requires Delphi 2010 or later.
|
||||
|
||||
## Building and Running
|
||||
* Open the project group `GildedRose.groupproj`.
|
||||
* Build and run the `TextTestFixture.exe` for the text output tests.
|
||||
* Build and run the `UnitTests.exe` project to execute the unit tests.
|
||||
@ -1,57 +0,0 @@
|
||||
program TextTestFixture;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
{$R *.res}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
System.Generics.Collections,
|
||||
GildedRose in 'GildedRose.pas',
|
||||
Item in 'Item.pas';
|
||||
|
||||
var
|
||||
Days, ErrorCode, I, J: Integer;
|
||||
Items: TObjectList<TItem>;
|
||||
App: TGildedRose;
|
||||
|
||||
begin
|
||||
try
|
||||
Writeln('OMGHAI!');
|
||||
|
||||
Items := TObjectList<TItem>.Create;
|
||||
Items.Add(TItem.Create('+5 Dexterity Vest', 10, 20));
|
||||
Items.Add(TItem.Create('Aged Brie', 2, 0));
|
||||
Items.Add(TItem.Create('Elixir of the Mongoose', 5, 7));
|
||||
Items.Add(TItem.Create('Sulfuras, Hand of Ragnaros', 0, 80));
|
||||
Items.Add(TItem.Create('Sulfuras, Hand of Ragnaros', -1, 80));
|
||||
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 15, 20));
|
||||
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 10, 49));
|
||||
Items.Add(TItem.Create('Backstage passes to a TAFKAL80ETC concert', 5, 49));
|
||||
// this conjured item does not work properly yet
|
||||
Items.Add(TItem.Create('Conjured Mana Cake', 3, 6));
|
||||
|
||||
App := TGildedRose.Create(Items);
|
||||
|
||||
Days := 2;
|
||||
if ParamCount > 0 then
|
||||
begin
|
||||
Val(ParamStr(1), Days, ErrorCode);
|
||||
Inc(Days);
|
||||
end;
|
||||
|
||||
for I := 0 to Days - 1 do
|
||||
begin
|
||||
Writeln(Format('-------- day %d --------', [I]));
|
||||
Writeln('name, sellIn, quality');
|
||||
for J := 0 to Items.Count - 1 do
|
||||
Writeln(Items[J].ToString);
|
||||
Writeln;
|
||||
|
||||
App.UpdateQuality;
|
||||
end;
|
||||
except
|
||||
on E: Exception do
|
||||
Writeln(E.ClassName, ': ', E.Message);
|
||||
end;
|
||||
end.
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,59 +0,0 @@
|
||||
program UnitTests;
|
||||
|
||||
{$IFNDEF TESTINSIGHT}
|
||||
{$APPTYPE CONSOLE}
|
||||
{$ENDIF}{$STRONGLINKTYPES ON}
|
||||
uses
|
||||
System.SysUtils,
|
||||
{$IFDEF TESTINSIGHT}
|
||||
TestInsight.DUnitX,
|
||||
{$ENDIF }
|
||||
DUnitX.Loggers.Console,
|
||||
DUnitX.Loggers.Xml.NUnit,
|
||||
DUnitX.TestFramework,
|
||||
GildedRoseTests in 'GildedRoseTests.pas';
|
||||
|
||||
var
|
||||
runner : ITestRunner;
|
||||
results : IRunResults;
|
||||
logger : ITestLogger;
|
||||
nunitLogger : ITestLogger;
|
||||
begin
|
||||
{$IFDEF TESTINSIGHT}
|
||||
TestInsight.DUnitX.RunRegisteredTests;
|
||||
exit;
|
||||
{$ENDIF}
|
||||
try
|
||||
//Check command line options, will exit if invalid
|
||||
TDUnitX.CheckCommandLine;
|
||||
//Create the test runner
|
||||
runner := TDUnitX.CreateRunner;
|
||||
//Tell the runner to use RTTI to find Fixtures
|
||||
runner.UseRTTI := True;
|
||||
//tell the runner how we will log things
|
||||
//Log to the console window
|
||||
logger := TDUnitXConsoleLogger.Create(true);
|
||||
runner.AddLogger(logger);
|
||||
//Generate an NUnit compatible XML File
|
||||
nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
|
||||
runner.AddLogger(nunitLogger);
|
||||
runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
|
||||
|
||||
//Run tests
|
||||
results := runner.Execute;
|
||||
if not results.AllPassed then
|
||||
System.ExitCode := EXIT_ERRORS;
|
||||
|
||||
{$IFNDEF CI}
|
||||
//We don't want this happening when running under CI.
|
||||
if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
|
||||
begin
|
||||
System.Write('Done.. press <Enter> key to quit.');
|
||||
System.Readln;
|
||||
end;
|
||||
{$ENDIF}
|
||||
except
|
||||
on E: Exception do
|
||||
System.Writeln(E.ClassName, ': ', E.Message);
|
||||
end;
|
||||
end.
|
||||
@ -1,937 +0,0 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{9379A28B-85A1-455B-BE8B-BDE5DD446BDF}</ProjectGuid>
|
||||
<ProjectVersion>18.8</ProjectVersion>
|
||||
<FrameworkType>None</FrameworkType>
|
||||
<MainSource>UnitTests.dpr</MainSource>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
<AppType>Console</AppType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='iOSDevice32' and '$(Base)'=='true') or '$(Base_iOSDevice32)'!=''">
|
||||
<Base_iOSDevice32>true</Base_iOSDevice32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='iOSDevice64' and '$(Base)'=='true') or '$(Base_iOSDevice64)'!=''">
|
||||
<Base_iOSDevice64>true</Base_iOSDevice64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='iOSSimulator' and '$(Base)'=='true') or '$(Base_iOSSimulator)'!=''">
|
||||
<Base_iOSSimulator>true</Base_iOSSimulator>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='OSX32' and '$(Base)'=='true') or '$(Base_OSX32)'!=''">
|
||||
<Base_OSX32>true</Base_OSX32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='OSX64' and '$(Base)'=='true') or '$(Base_OSX64)'!=''">
|
||||
<Base_OSX64>true</Base_OSX64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||
<Base_Win64>true</Base_Win64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
|
||||
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
|
||||
<DCC_E>false</DCC_E>
|
||||
<DCC_N>false</DCC_N>
|
||||
<DCC_S>false</DCC_S>
|
||||
<DCC_F>false</DCC_F>
|
||||
<DCC_K>false</DCC_K>
|
||||
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
|
||||
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
|
||||
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
|
||||
<DCC_UnitSearchPath>$(DUnitX);$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
|
||||
<SanitizedProjectName>UnitTests</SanitizedProjectName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_iOSDevice32)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_iOSDevice64)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_iOSSimulator)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;bindcompfmx;FmxTeeUI;fmx;FireDACIBDriver;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;DataSnapNativeClient;FireDACDSDriver;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_OSX32)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;fmx;FireDACIBDriver;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;FireDACDSDriver;rtl;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_OSX64)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXInterBaseDriver;emsclientfiredac;tethering;DataSnapFireDAC;FireDACMSSQLDriver;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;fmx;FireDACIBDriver;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;FireDACDSDriver;rtl;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;bindcomp;DBXInformixDriver;IndyIPClient;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;tethering;svnui;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;FireDACIBDriver;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
<BT_BuildType>Debug</BT_BuildType>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;fmxase;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;emsclientfiredac;tethering;DataSnapFireDAC;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;fmx;FireDACIBDriver;fmxdae;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;emsclient;DataSnapCommon;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;DBXSybaseASEDriver;IndySystem;FireDACDb2Driver;dsnapcon;FireDACMSAccDriver;fmxFireDAC;FireDACInfxDriver;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;inetdbxpress;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
<DCC_DebugDCUs>true</DCC_DebugDCUs>
|
||||
<DCC_Optimize>false</DCC_Optimize>
|
||||
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||
<DCC_RemoteDebug>true</DCC_RemoteDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<DCC_RemoteDebug>false</DCC_RemoteDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="$(MainSource)">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="GildedRoseTests.pas"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType>Console</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<Delphi.Personality>
|
||||
<Source>
|
||||
<Source Name="MainSource">UnitTests.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality>
|
||||
<Deployment Version="3">
|
||||
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
|
||||
<Platform Name="OSX32">
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
|
||||
<Platform Name="iOSSimulator">
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
|
||||
<Platform Name="iOSSimulator">
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployFile LocalName="Win32\Debug\UnitTests.exe" Configuration="Debug" Class="ProjectOutput">
|
||||
<Platform Name="Win32">
|
||||
<RemoteName>UnitTests.exe</RemoteName>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployClass Name="AdditionalDebugSymbols">
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidClassesDexFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>classes</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>classes</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidFileProvider">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\xml</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\xml</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidGDBServer">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeArmeabiFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeMipsFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\mips</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\mips</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidServiceOutput">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidServiceOutput_Android32">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashImageDef">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashStyles">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashStylesV21">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values-v21</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values-v21</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_Colors">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_DefaultAppIcon">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon144">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon36">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon48">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon72">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon96">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon24">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon36">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon48">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon72">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon96">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage426">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-small</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-small</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage470">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage640">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-large</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-large</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage960">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_Strings">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DebugSymbols">
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DependencyFramework">
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.framework</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.framework</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DependencyModule">
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
<Extensions>.dll;.bpl</Extensions>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Required="true" Name="DependencyPackage">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
<Extensions>.bpl</Extensions>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="File">
|
||||
<Platform Name="Android">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch1024x768">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch1536x2048">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch1668">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch1668x2388">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2048x1536">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2048x2732">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2224">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2388x1668">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2732x2048">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch768x1024">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1125">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1136x640">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1242">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1242x2688">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1334">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch1792">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch2208">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch2436">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch2688x1242">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch320">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch640">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch640x1136">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch750">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch828">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectAndroidManifest">
|
||||
<Platform Name="Android">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSDeviceDebug">
|
||||
<Platform Name="iOSDevice32">
|
||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSDeviceResourceRules"/>
|
||||
<DeployClass Name="ProjectiOSEntitlements"/>
|
||||
<DeployClass Name="ProjectiOSInfoPList"/>
|
||||
<DeployClass Name="ProjectiOSResource">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOSXDebug"/>
|
||||
<DeployClass Name="ProjectOSXEntitlements"/>
|
||||
<DeployClass Name="ProjectOSXInfoPList"/>
|
||||
<DeployClass Name="ProjectOSXResource">
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\Resources</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\Resources</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Required="true" Name="ProjectOutput">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Linux64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOutput_Android32">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectUWPManifest">
|
||||
<Platform Name="Win32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="UWP_DelphiLogo150">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="UWP_DelphiLogo44">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
|
||||
</Deployment>
|
||||
<Platforms>
|
||||
<Platform value="iOSDevice32">False</Platform>
|
||||
<Platform value="iOSDevice64">False</Platform>
|
||||
<Platform value="iOSSimulator">False</Platform>
|
||||
<Platform value="OSX32">False</Platform>
|
||||
<Platform value="OSX64">False</Platform>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
|
||||
</Project>
|
||||
124
Groovy/.gitignore
vendored
124
Groovy/.gitignore
vendored
@ -1,124 +0,0 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/groovy,intellij,eclipse,vim
|
||||
|
||||
#!! ERROR: groovy is undefined. Use list command to see defined gitignore types !!#
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff:
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/dictionaries
|
||||
.idea/vcs.xml
|
||||
.idea/jsLibraryMappings.xml
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
.idea/dataSources.ids
|
||||
.idea/dataSources.xml
|
||||
.idea/dataSources.local.xml
|
||||
.idea/sqlDataSources.xml
|
||||
.idea/dynamic.xml
|
||||
.idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
.idea/gradle.xml
|
||||
.idea/libraries
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
.idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
### Intellij Patch ###
|
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||
|
||||
# *.iml
|
||||
# modules.xml
|
||||
|
||||
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
|
||||
### Vim ###
|
||||
# swap
|
||||
[._]*.s[a-w][a-z]
|
||||
[._]s[a-w][a-z]
|
||||
# session
|
||||
Session.vim
|
||||
# temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# auto-generated tag files
|
||||
tags
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<resourceExtensions />
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="!?*.java" />
|
||||
<entry name="!?*.form" />
|
||||
<entry name="!?*.class" />
|
||||
<entry name="!?*.groovy" />
|
||||
<entry name="!?*.scala" />
|
||||
<entry name="!?*.flex" />
|
||||
<entry name="!?*.kt" />
|
||||
<entry name="!?*.clj" />
|
||||
<entry name="!?*.aj" />
|
||||
</wildcardResourcePatterns>
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="false">
|
||||
<processorPath useClasspath="true" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,3 +0,0 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="" />
|
||||
</component>
|
||||
@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="mavenHome" value="Bundled (Maven 3)" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Groovy.iml" filepath="$PROJECT_DIR$/Groovy.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Current Groovy (sdkman)" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,17 +0,0 @@
|
||||
Welcome to the Groovy Gilded Rose
|
||||
=================================
|
||||
|
||||
to run the test, you can either:
|
||||
- run them from your favorite IDE
|
||||
- make sure you have installed language support for Groovy
|
||||
- IntelliJ:
|
||||
- open project
|
||||
- choose this folder (Groovy)
|
||||
- Eclipse:
|
||||
- new Groovy Project
|
||||
- choose this folder (Groovy) as the project folder
|
||||
- add JUnit to build path
|
||||
- run the test from the src/ folder in your shell:
|
||||
- $ cd src/
|
||||
- $ groovy com/gildedrose/GildedRoseTest.groovy
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
class GildedRose {
|
||||
Item[] items
|
||||
|
||||
GildedRose(Item[] items) {
|
||||
this.items = items
|
||||
}
|
||||
|
||||
void updateQuality() {
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
if (!items[i].name.equals("Aged Brie")
|
||||
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
|
||||
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].sellIn < 11) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].sellIn = items[i].sellIn - 1
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0) {
|
||||
if (!items[i].name.equals("Aged Brie")) {
|
||||
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
items[i].quality = items[i].quality - items[i].quality
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
class GildedRoseTest {
|
||||
|
||||
@Test
|
||||
void "foo"() {
|
||||
def items = [ new Item("foo", 0, 0) ] as Item[]
|
||||
def app = new GildedRose(items)
|
||||
app.updateQuality()
|
||||
assert "fixme" == app.items[0].name
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
class Item {
|
||||
|
||||
String name
|
||||
|
||||
int sellIn
|
||||
|
||||
int quality
|
||||
|
||||
Item(String name, int sellIn, int quality) {
|
||||
this.name = name
|
||||
this.sellIn = sellIn
|
||||
this.quality = quality
|
||||
}
|
||||
|
||||
@Override
|
||||
String toString() {
|
||||
return this.name + ", " + this.sellIn + ", " + this.quality
|
||||
}
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
println("OMGHAI!")
|
||||
|
||||
Item[] items = [
|
||||
new Item("+5 Dexterity Vest", 10, 20),
|
||||
new Item("Aged Brie", 2, 0),
|
||||
new Item("Elixir of the Mongoose", 5, 7),
|
||||
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
|
||||
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
new Item("Conjured Mana Cake", 3, 6)] as Item[]
|
||||
|
||||
GildedRose app = new GildedRose(items)
|
||||
|
||||
int days = 2
|
||||
if (args.length > 0) {
|
||||
days = Integer.parseInt(args[0]) + 1
|
||||
}
|
||||
|
||||
for (int i = 0; i < days; i++) {
|
||||
println("-------- day " + i + " --------")
|
||||
println("name, sellIn, quality")
|
||||
for (Item item in items) {
|
||||
println(item)
|
||||
}
|
||||
println ""
|
||||
app.updateQuality()
|
||||
}
|
||||
3
Java-Spock/.gitignore
vendored
3
Java-Spock/.gitignore
vendored
@ -1,3 +0,0 @@
|
||||
.idea/
|
||||
.gradle/
|
||||
build/
|
||||
@ -1,9 +0,0 @@
|
||||
apply plugin: 'groovy'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
|
||||
}
|
||||
BIN
Java-Spock/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
Java-Spock/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,6 +0,0 @@
|
||||
#Tue Jul 05 09:24:35 CEST 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
|
||||
160
Java-Spock/gradlew
vendored
160
Java-Spock/gradlew
vendored
@ -1,160 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
90
Java-Spock/gradlew.bat
vendored
90
Java-Spock/gradlew.bat
vendored
@ -1,90 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@ -1,62 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
class GildedRose {
|
||||
Item[] items;
|
||||
|
||||
public GildedRose(Item[] items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public void updateQuality() {
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
if (!items[i].name.equals("Aged Brie")
|
||||
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
|
||||
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].sellIn < 11) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].sellIn = items[i].sellIn - 1;
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0) {
|
||||
if (!items[i].name.equals("Aged Brie")) {
|
||||
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
items[i].quality = items[i].quality - items[i].quality;
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
public class Item {
|
||||
|
||||
public String name;
|
||||
|
||||
public int sellIn;
|
||||
|
||||
public int quality;
|
||||
|
||||
public Item(String name, int sellIn, int quality) {
|
||||
this.name = name;
|
||||
this.sellIn = sellIn;
|
||||
this.quality = quality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name + ", " + this.sellIn + ", " + this.quality;
|
||||
}
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
public class TexttestFixture {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("OMGHAI!");
|
||||
|
||||
Item[] items = new Item[] {
|
||||
new Item("+5 Dexterity Vest", 10, 20), //
|
||||
new Item("Aged Brie", 2, 0), //
|
||||
new Item("Elixir of the Mongoose", 5, 7), //
|
||||
new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
|
||||
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
new Item("Conjured Mana Cake", 3, 6) };
|
||||
|
||||
GildedRose app = new GildedRose(items);
|
||||
|
||||
int days = 2;
|
||||
if (args.length > 0) {
|
||||
days = Integer.parseInt(args[0]) + 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < days; i++) {
|
||||
System.out.println("-------- day " + i + " --------");
|
||||
System.out.println("name, sellIn, quality");
|
||||
for (Item item : items) {
|
||||
System.out.println(item);
|
||||
}
|
||||
System.out.println();
|
||||
app.updateQuality();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
import spock.lang.Specification
|
||||
|
||||
/**
|
||||
* Spock unit tests.
|
||||
*/
|
||||
class GildedRoseSpec extends Specification {
|
||||
|
||||
def "should update quality correctly"() {
|
||||
|
||||
given: "some items"
|
||||
Item[] items = [new Item("foo", 0, 0)];
|
||||
|
||||
and: "the application with these items"
|
||||
GildedRose app = new GildedRose(items);
|
||||
|
||||
when: "updating quality"
|
||||
app.updateQuality();
|
||||
|
||||
then: "the quality is correct"
|
||||
app.items[0].name == "fixme"
|
||||
}
|
||||
|
||||
}
|
||||
13
Java/.gitignore
vendored
13
Java/.gitignore
vendored
@ -1,13 +0,0 @@
|
||||
.idea/
|
||||
*.iml
|
||||
target/
|
||||
|
||||
.classpath
|
||||
.project
|
||||
bin/
|
||||
.settings/
|
||||
|
||||
# Gradle
|
||||
.gradle
|
||||
/build/
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.6.2'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
|
||||
testImplementation 'com.approvaltests:approvaltests:5.0.0'
|
||||
}
|
||||
|
||||
group = 'com.gildedrose'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
sourceCompatibility = '1.8'
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
BIN
Java/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
Java/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
183
Java/gradlew
vendored
183
Java/gradlew
vendored
@ -1,183 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
100
Java/gradlew.bat
vendored
100
Java/gradlew.bat
vendored
@ -1,100 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
43
Java/pom.xml
43
Java/pom.xml
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.gildedrose</groupId>
|
||||
<artifactId>gilded-rose-kata</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<junit.jupiter.version>5.6.2</junit.jupiter.version>
|
||||
<maven.maven-surefire-plugin.version>3.0.0-M4</maven.maven-surefire-plugin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>${junit.jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${maven.maven-surefire-plugin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -1 +0,0 @@
|
||||
rootProject.name = 'gilded-rose-kata'
|
||||
@ -1,62 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
class GildedRose {
|
||||
Item[] items;
|
||||
|
||||
public GildedRose(Item[] items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public void updateQuality() {
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
if (!items[i].name.equals("Aged Brie")
|
||||
&& !items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
|
||||
if (items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].sellIn < 11) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].sellIn = items[i].sellIn - 1;
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0) {
|
||||
if (!items[i].name.equals("Aged Brie")) {
|
||||
if (!items[i].name.equals("Backstage passes to a TAFKAL80ETC concert")) {
|
||||
if (items[i].quality > 0) {
|
||||
if (!items[i].name.equals("Sulfuras, Hand of Ragnaros")) {
|
||||
items[i].quality = items[i].quality - 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
items[i].quality = items[i].quality - items[i].quality;
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
public class Item {
|
||||
|
||||
public String name;
|
||||
|
||||
public int sellIn;
|
||||
|
||||
public int quality;
|
||||
|
||||
public Item(String name, int sellIn, int quality) {
|
||||
this.name = name;
|
||||
this.sellIn = sellIn;
|
||||
this.quality = quality;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name + ", " + this.sellIn + ", " + this.quality;
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
class GildedRoseTest {
|
||||
|
||||
@Test
|
||||
void foo() {
|
||||
Item[] items = new Item[] { new Item("foo", 0, 0) };
|
||||
GildedRose app = new GildedRose(items);
|
||||
app.updateQuality();
|
||||
assertEquals("fixme", app.items[0].name);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.gildedrose;
|
||||
|
||||
public class TexttestFixture {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("OMGHAI!");
|
||||
|
||||
Item[] items = new Item[] {
|
||||
new Item("+5 Dexterity Vest", 10, 20), //
|
||||
new Item("Aged Brie", 2, 0), //
|
||||
new Item("Elixir of the Mongoose", 5, 7), //
|
||||
new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
|
||||
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
new Item("Conjured Mana Cake", 3, 6) };
|
||||
|
||||
GildedRose app = new GildedRose(items);
|
||||
|
||||
int days = 2;
|
||||
if (args.length > 0) {
|
||||
days = Integer.parseInt(args[0]) + 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < days; i++) {
|
||||
System.out.println("-------- day " + i + " --------");
|
||||
System.out.println("name, sellIn, quality");
|
||||
for (Item item : items) {
|
||||
System.out.println(item);
|
||||
}
|
||||
System.out.println();
|
||||
app.updateQuality();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -23,6 +23,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/emilybache/GildedRose-Refactoring-Kata",
|
||||
"devDependencies": {
|
||||
"jest": "^24.9.0"
|
||||
"jest": "26.6.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
3639
JavaScript/yarn.lock
Normal file
3639
JavaScript/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
25
Kotlin/.gitignore
vendored
25
Kotlin/.gitignore
vendored
@ -1,25 +0,0 @@
|
||||
.idea/
|
||||
out/
|
||||
*.class
|
||||
|
||||
*.iml
|
||||
|
||||
# Created by https://www.gitignore.io/api/gradle
|
||||
|
||||
### Gradle ###
|
||||
.gradle
|
||||
**/build/
|
||||
|
||||
# Ignore Gradle GUI config
|
||||
gradle-app.setting
|
||||
|
||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
|
||||
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||
# gradle/wrapper/gradle-wrapper.properties
|
||||
|
||||
# End of https://www.gitignore.io/api/gradle
|
||||
@ -1,29 +0,0 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.4.0"
|
||||
}
|
||||
|
||||
group = "com.gildedrose"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events("passed", "skipped", "failed")
|
||||
}
|
||||
}
|
||||
|
||||
// config JVM target to 1.8 for kotlin compilation tasks
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
BIN
Kotlin/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
Kotlin/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
188
Kotlin/gradlew
vendored
188
Kotlin/gradlew
vendored
@ -1,188 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
100
Kotlin/gradlew.bat
vendored
100
Kotlin/gradlew.bat
vendored
@ -1,100 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@ -1,58 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
class GildedRose(var items: Array<Item>) {
|
||||
|
||||
fun updateQuality() {
|
||||
for (i in items.indices) {
|
||||
if (items[i].name != "Aged Brie" && items[i].name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].quality > 0) {
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
|
||||
if (items[i].name == "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].sellIn < 11) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 6) {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
items[i].sellIn = items[i].sellIn - 1
|
||||
}
|
||||
|
||||
if (items[i].sellIn < 0) {
|
||||
if (items[i].name != "Aged Brie") {
|
||||
if (items[i].name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (items[i].quality > 0) {
|
||||
if (items[i].name != "Sulfuras, Hand of Ragnaros") {
|
||||
items[i].quality = items[i].quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
items[i].quality = items[i].quality - items[i].quality
|
||||
}
|
||||
} else {
|
||||
if (items[i].quality < 50) {
|
||||
items[i].quality = items[i].quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
open class Item(var name: String, var sellIn: Int, var quality: Int) {
|
||||
override fun toString(): String {
|
||||
return this.name + ", " + this.sellIn + ", " + this.quality
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
internal class GildedRoseTest {
|
||||
|
||||
@Test
|
||||
fun foo() {
|
||||
val items = arrayOf<Item>(Item("foo", 0, 0))
|
||||
val app = GildedRose(items)
|
||||
app.updateQuality()
|
||||
assertEquals("fixme", app.items[0].name)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
package com.gildedrose
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
println("OMGHAI!")
|
||||
|
||||
val items = arrayOf(Item("+5 Dexterity Vest", 10, 20), //
|
||||
Item("Aged Brie", 2, 0), //
|
||||
Item("Elixir of the Mongoose", 5, 7), //
|
||||
Item("Sulfuras, Hand of Ragnaros", 0, 80), //
|
||||
Item("Sulfuras, Hand of Ragnaros", -1, 80),
|
||||
Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
|
||||
Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
|
||||
Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
Item("Conjured Mana Cake", 3, 6))
|
||||
|
||||
val app = GildedRose(items)
|
||||
|
||||
var days = 2
|
||||
if (args.size > 0) {
|
||||
days = Integer.parseInt(args[0]) + 1
|
||||
}
|
||||
|
||||
for (i in 0..days - 1) {
|
||||
println("-------- day $i --------")
|
||||
println("name, sellIn, quality")
|
||||
for (item in items) {
|
||||
println(item)
|
||||
}
|
||||
println()
|
||||
app.updateQuality()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
18
R/.project
18
R/.project
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>GildedRose.R</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>de.walware.statet.r.builders.RSupport</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>de.walware.statet.base.StatetNature</nature>
|
||||
<nature>de.walware.statet.r.RNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@ -1,56 +0,0 @@
|
||||
source('item.R')
|
||||
|
||||
update_quality <- function(items) {
|
||||
lapply(items,
|
||||
function(item) {
|
||||
|
||||
if (item$name != "Aged Brie" && item$name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (item$quality > 0) {
|
||||
if (item$name != "Sulfuras, Hand of Ragnaros") {
|
||||
item$quality <- item$quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (item$quality < 50) {
|
||||
item$quality <- item$quality + 1
|
||||
if (item$name == "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (item$sell_in < 11) {
|
||||
if (item$quality < 50) {
|
||||
item$quality = item$quality + 1
|
||||
}
|
||||
}
|
||||
if (item$sell_in < 6) {
|
||||
if (item$quality < 50) {
|
||||
item$quality = item$quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item$name != "Sulfuras, Hand of Ragnaros") {
|
||||
item$sell_in <- item$sell_in - 1
|
||||
}
|
||||
|
||||
if (item$sell_in < 0) {
|
||||
if (item$name != "Aged Brie") {
|
||||
if (item$name != "Backstage passes to a TAFKAL80ETC concert") {
|
||||
if (item$quality > 0) {
|
||||
if (item$name != "Sulfuras, Hand of Ragnaros") {
|
||||
item$quality <- item$quality - 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item$quality <- item$quality - item$quality
|
||||
}
|
||||
} else {
|
||||
if (item$quality < 50) {
|
||||
item$quality <- item$quality + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item
|
||||
}
|
||||
)
|
||||
}
|
||||
13
R/item.R
13
R/item.R
@ -1,13 +0,0 @@
|
||||
item <- function(name, sell_in, quality) {
|
||||
newItem <- list(name=name, sell_in=sell_in, quality=quality)
|
||||
class(newItem) <- 'item'
|
||||
newItem
|
||||
}
|
||||
|
||||
as.character.item <- function(item) {
|
||||
paste(item$name, ", ", item$sell_in, ", ", item$quality, sep='')
|
||||
}
|
||||
|
||||
print.item <- function(item) {
|
||||
print.default(as.character(item))
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
source('gilded_rose.R')
|
||||
|
||||
test.foo <- function() {
|
||||
items <- list( item('foo', 0, 0) )
|
||||
items <- update_quality(items)
|
||||
checkEquals('fixme', items[[1]]$name);
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
# A little helper script to get the testing infrastructure started
|
||||
|
||||
# install.packages("RUnit")
|
||||
require(RUnit)
|
||||
|
||||
# execute single test file
|
||||
runTestFile("runit_gilded_rose.R")
|
||||
@ -1,33 +0,0 @@
|
||||
rm(list=ls())
|
||||
|
||||
source('gilded_rose.R')
|
||||
|
||||
writeLines('OMGHAI!')
|
||||
|
||||
items <- list(
|
||||
item('+5 Dexterity Vest', 10, 20),
|
||||
item('Aged Brie', 2, 0),
|
||||
item('Elixir of the Mongoose', 5, 7),
|
||||
item('Sulfuras, Hand of Ragnaros', 0, 80),
|
||||
item('Sulfuras, Hand of Ragnaros', -1, 80),
|
||||
item('Backstage passes to a TAFKAL80ETC concert', 15, 20),
|
||||
item('Backstage passes to a TAFKAL80ETC concert', 10, 49),
|
||||
item('Backstage passes to a TAFKAL80ETC concert', 5, 49),
|
||||
# This Conjured item does not work properly yet
|
||||
item('Conjured Mana Cake', 3, 6)
|
||||
)
|
||||
|
||||
days <- 2
|
||||
for (day in 0:days) {
|
||||
writeLines(paste('-------- day ', day, ' --------', sep=''))
|
||||
writeLines('name, sellIn, quality')
|
||||
lapply(items,
|
||||
function(item) {
|
||||
writeLines(as.character(item))
|
||||
}
|
||||
)
|
||||
writeLines('')
|
||||
items <- update_quality(items)
|
||||
}
|
||||
|
||||
rm('day', 'days', 'items')
|
||||
@ -1,160 +0,0 @@
|
||||
Object subclass: #GildedRose
|
||||
instanceVariableNames: ''
|
||||
classVariableNames: ''
|
||||
poolDictionaries: ''
|
||||
category: 'GildedRose'!
|
||||
!GildedRose commentStamp: 'AndreasLeidig 4/21/2012 15:38' prior: 0!
|
||||
This Kata was originally created by Terry Hughes (http://twitter.com/#!!/TerryHughes). It is already on GitHub as "GildedRose", a sample project for C#. I could have forked it again, but I thought other language users might not want to download a whole C# project environment. In this repository are starting code samples for Java, Python, Ruby, C# and C++.
|
||||
|
||||
See also http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/
|
||||
|
||||
====================
|
||||
How to use this Kata
|
||||
====================
|
||||
|
||||
The simplest way is to just clone the code and start hacking away improving the design. You'll want to look at the "Gilded Rose Background Reading" (below) which explains what the code is for. I strongly advise you that you'll also need some tests if you want to make sure you don't break the code while you refactor.
|
||||
|
||||
You could write some unit tests yourself, using the Kata Background Reading (below) to identify suitable test cases. I've provided a failing unit test in a popular test framework as a starting point for most languages.
|
||||
|
||||
Alternatively, use the "Text-Based" tests provided in this repository. (Read more about that in the next section)
|
||||
|
||||
Whichever testing approach you choose, the idea of the exercise is to do some deliberate practice, and improve your Refactoring skills. The idea is not to re-write the code from scratch, but rather to practice taking small steps, running the tests often, and incrementally improving the design.
|
||||
|
||||
==================
|
||||
Text-Based Testing
|
||||
==================
|
||||
|
||||
This is a testing approach which is very useful when refactoring legacy code. The basic idea is to create tests that use the text which the code produces. Before you change the code, you run it, and save the output as a "Golden Copy". Then after you change the code, you run it again, and compare the output against the Golden Copy. Any differences, and the test fails.
|
||||
|
||||
It's basically the same idea as "assertEquals(expected, actual)" in a unit test, except the text you are comparing is typically much longer, and the "expected" value is saved from actual output, rather than being defined in advance.
|
||||
|
||||
Typically a piece of legacy code may not produce suitable textual output from the start, so you may need to modify it before you can write your first text-based test. That could involve inserting log statements into the code, or just writing a "main" method that executes the code and prints out what the result is afterwards. It's this latter approach we are using here to test GildedRose.
|
||||
|
||||
The Text-Based tests in this repository are designed to be used with the tool "TextTest" (http://texttest.org). This tool helps you to organize and run text-based tests. There is more information in the README file in the "texttests" subdirectory.
|
||||
|
||||
===================================
|
||||
Gilded Rose Kata Background Reading
|
||||
===================================
|
||||
|
||||
Hi and welcome to team Gilded Rose. As you know, we are a small inn with a prime location in a prominent city ran by a friendly innkeeper named Allison. We also buy and sell only the finest goods. Unfortunately, our goods are constantly degrading in quality as they approach their sell by date. We have a system in place that updates our inventory for us. It was developed by a no-nonsense type named Leeroy, who has moved on to new adventures. Your task is to add the new feature to our system so that we can begin selling a new category of items. First an introduction to our system:
|
||||
|
||||
- All items have a SellIn value which denotes the number of days we have to sell the item
|
||||
- All items have a Quality value which denotes how valuable the item is
|
||||
- At the end of each day our system lowers both values for every item
|
||||
|
||||
Pretty simple, right? Well this is where it gets interesting:
|
||||
|
||||
- Once the sell by date has passed, Quality degrades twice as fast
|
||||
- The Quality of an item is never negative
|
||||
- "Aged Brie" actually increases in Quality the older it gets
|
||||
- The Quality of an item is never more than 50
|
||||
- "Sulfuras", being a legendary item, never has to be sold or decreases in Quality
|
||||
- "Backstage passes", like aged brie, increases in Quality as it's SellIn value approaches; Quality increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but Quality drops to 0 after the concert
|
||||
|
||||
We have recently signed a supplier of conjured items. This requires an update to our system:
|
||||
|
||||
- "Conjured" items degrade in Quality twice as fast as normal items
|
||||
|
||||
Feel free to make any changes to the UpdateQuality method and add any new code as long as everything still works correctly. However, do not alter the Item class or Items property as those belong to the goblin in the corner who will insta-rage and one-shot you as he doesn't believe in shared code ownership (you can make the UpdateQuality method and Items property static if you like, we'll cover for you).
|
||||
|
||||
Just for clarification, an item can never have its Quality increase above 50, however "Sulfuras" is a legendary item and as such its Quality is 80 and it never alters.!
|
||||
|
||||
|
||||
!GildedRose methodsFor: 'API' stamp: 'AndreasLeidig 4/21/2012 17:02'!
|
||||
updateQualityFor: items
|
||||
items
|
||||
do: [:item |
|
||||
(item name ~= 'Aged Brie'
|
||||
and: [item name ~= 'Backstage passes to a TAFKAL80ETC concert'])
|
||||
ifTrue: [item quality > 0
|
||||
ifTrue: [item name ~= 'Sulfuras, Hand of Ragnaros'
|
||||
ifTrue: [item quality: item quality - 1]]]
|
||||
ifFalse: [item quality < 50
|
||||
ifTrue: [item quality: item quality + 1.
|
||||
item name = 'Backstage passes to a TAFKAL80ETC concert'
|
||||
ifTrue: [item sellIn < 11
|
||||
ifTrue: [item quality < 50
|
||||
ifTrue: [item quality: item quality + 1]].
|
||||
item sellIn < 6
|
||||
ifTrue: [item quality < 50
|
||||
ifTrue: [item quality: item quality + 1]]]]].
|
||||
item name ~= 'Sulfuras, Hand of Ragnaros'
|
||||
ifTrue: [item sellIn: item sellIn - 1].
|
||||
item sellIn < 0
|
||||
ifTrue: [item name ~= 'Aged Brie'
|
||||
ifTrue: [item name ~= 'Backstage passes to a TAFKAL80ETC concert'
|
||||
ifTrue: [item quality > 0
|
||||
ifTrue: [item name ~= 'Sulfuras, Hand of Ragnaros'
|
||||
ifTrue: [item quality: item quality - 1]]]
|
||||
ifFalse: [item quality: item quality - item quality]]
|
||||
ifFalse: [item quality < 50
|
||||
ifTrue: [item quality: item quality + 1]]]]! !
|
||||
|
||||
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
|
||||
|
||||
GildedRose class
|
||||
instanceVariableNames: ''!
|
||||
|
||||
!GildedRose class methodsFor: 'run Example' stamp: 'AndreasLeidig 4/21/2012 20:26'!
|
||||
runExamples
|
||||
"GildedRose runExamples"
|
||||
| items gildedRose |
|
||||
items := OrderedCollection new
|
||||
add: (Item new name: '+5 Dexterity Vest'; sellIn: 10; quality: 20; yourself);
|
||||
add: (Item new name: 'Aged Brie'; sellIn: 2; quality: 0; yourself);
|
||||
add: (Item new name: 'Elixir of the Mongoose'; sellIn: 5; quality: 7; yourself);
|
||||
add: (Item new name: 'Sulfuras, Hand of Ragnaros'; sellIn: 0; quality: 80; yourself);
|
||||
add: (Item new name: 'Sulfuras, Hand of Ragnaros'; sellIn: -1; quality: 80; yourself);
|
||||
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 15; quality: 20; yourself);
|
||||
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 10; quality: 49; yourself);
|
||||
add: (Item new name: 'Backstage passes to a TAFKAL80ETC concert'; sellIn: 5; quality: 49; yourself);
|
||||
add: (Item new name: 'Conjured Mana Cake'; sellIn: 3; quality: 6; yourself); "this conjured item does not work properly yet"
|
||||
yourself.
|
||||
|
||||
gildedRose := GildedRose new.
|
||||
Transcript show: 'OMGHAI!!';
|
||||
cr.
|
||||
0 to: 30 do: [:idx |
|
||||
Transcript show: '-------- day ' , idx printString , ' --------';
|
||||
cr;
|
||||
show: 'name, sellIn, quality';
|
||||
cr.
|
||||
items
|
||||
do: [:item |
|
||||
Transcript show: item name , ', ' , item sellIn printString , ', ' , item quality printString;
|
||||
cr].
|
||||
Transcript cr.
|
||||
gildedRose updateQualityFor: items].
|
||||
Transcript cr! !
|
||||
|
||||
|
||||
Object subclass: #Item
|
||||
instanceVariableNames: 'name sellIn quality'
|
||||
classVariableNames: ''
|
||||
poolDictionaries: ''
|
||||
category: 'GildedRose'!
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:40'!
|
||||
name
|
||||
^name! !
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:41'!
|
||||
name: aString
|
||||
name := aString! !
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:41'!
|
||||
quality
|
||||
^quality! !
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:42'!
|
||||
quality: aNumber
|
||||
quality := aNumber! !
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:41'!
|
||||
sellIn
|
||||
^sellIn! !
|
||||
|
||||
!Item methodsFor: 'accessing' stamp: 'AndreasLeidig 4/21/2012 15:42'!
|
||||
sellIn: aNumber
|
||||
sellIn := aNumber
|
||||
! !
|
||||
@ -11,16 +11,16 @@
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@types/chai": "~3.5.2",
|
||||
"@types/mocha": "~2.2.41",
|
||||
"@types/node": "~7.0.18",
|
||||
"chai": "~4.2.0",
|
||||
"mocha": "~8.2.1",
|
||||
"nyc": "~15.1.0",
|
||||
"rimraf": "~3.0.2",
|
||||
"@types/chai": "4.2.15",
|
||||
"@types/mocha": "8.2.2",
|
||||
"@types/node": "14.14.37",
|
||||
"chai": "4.3.4",
|
||||
"mocha": "8.3.2",
|
||||
"nyc": "15.1.0",
|
||||
"rimraf": "3.0.2",
|
||||
"source-map-support": "0.5.19",
|
||||
"ts-node": "~9.1.1",
|
||||
"typescript": "~4.1.3"
|
||||
"ts-node": "9.1.1",
|
||||
"typescript": "4.2.3"
|
||||
},
|
||||
"nyc": {
|
||||
"extension": [
|
||||
@ -38,4 +38,4 @@
|
||||
"text"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
1532
TypeScript/yarn.lock
Normal file
1532
TypeScript/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user