@@ -11,10 +11,6 @@ import 'package:test/test.dart';
11
11
12
12
void main () {
13
13
group ("create" , () {
14
- test ('build' , () {
15
- expect (AntBuildCommand (BuildCommandRunner ()).name, "build" );
16
- });
17
-
18
14
test ('make' , () {
19
15
expect (GradleBuildCommand (BuildCommandRunner ()).name, "make" );
20
16
});
@@ -35,8 +31,8 @@ void main() {
35
31
group ("spec" , () {
36
32
test ('build' , () async {
37
33
var runner = makeTestRunner ();
38
- await runner.run (["-r=19" , "-d../.." , "build " ]).whenComplete (() {
39
- var specs = (runner.commands['build ' ] as ProductCommand ).specs;
34
+ await runner.run (["-r=19" , "-d../.." , "make " ]).whenComplete (() {
35
+ var specs = (runner.commands['make ' ] as ProductCommand ).specs;
40
36
expect (specs, isNotNull);
41
37
expect (
42
38
specs.map ((spec) => spec.ideaProduct).toList (),
@@ -146,9 +142,9 @@ void main() {
146
142
group ('build' , () {
147
143
test ('plugin.xml' , () async {
148
144
var runner = makeTestRunner ();
149
- late TestBuildCommand cmd;
150
- await runner.run (["-d../.." , "build " ]).whenComplete (() {
151
- cmd = (runner.commands['build ' ] as TestBuildCommand );
145
+ late TestMakeCommand cmd;
146
+ await runner.run (["-d../.." , "make " ]).whenComplete (() {
147
+ cmd = (runner.commands['make ' ] as TestMakeCommand );
152
148
});
153
149
var spec = cmd.specs[0 ];
154
150
await removeAll ('../../build/classes' );
@@ -163,7 +159,7 @@ void main() {
163
159
164
160
test ('only-version' , () async {
165
161
ProductCommand command =
166
- makeTestRunner ().commands['build ' ] as ProductCommand ;
162
+ makeTestRunner ().commands['make ' ] as ProductCommand ;
167
163
var results = command.argParser.parse (['--only-version=2023.1' ]);
168
164
expect (results['only-version' ], '2023.1' );
169
165
});
@@ -173,41 +169,41 @@ void main() {
173
169
test ('parses release' , () async {
174
170
var runner = makeTestRunner ();
175
171
late ProductCommand command;
176
- await runner.run (["-d../.." , '-r22.0' , "build " ]).whenComplete (() {
177
- command = (runner.commands['build ' ] as ProductCommand );
172
+ await runner.run (["-d../.." , '-r22.0' , "make " ]).whenComplete (() {
173
+ command = (runner.commands['make ' ] as ProductCommand );
178
174
});
179
175
expect (command.release, '22.0' );
180
176
});
181
177
test ('parses release partial number' , () async {
182
178
var runner = makeTestRunner ();
183
179
late ProductCommand command;
184
- await runner.run (["-d../.." , '-r22' , "build " ]).whenComplete (() {
185
- command = (runner.commands['build ' ] as ProductCommand );
180
+ await runner.run (["-d../.." , '-r22' , "make " ]).whenComplete (() {
181
+ command = (runner.commands['make ' ] as ProductCommand );
186
182
});
187
183
expect (command.release, '22.0' );
188
184
});
189
185
190
186
test ('isReleaseValid' , () async {
191
187
var runner = makeTestRunner ();
192
188
late ProductCommand command;
193
- await runner.run (["-d../.." , '-r22.0' , "build " ]).whenComplete (() {
194
- command = (runner.commands['build ' ] as ProductCommand );
189
+ await runner.run (["-d../.." , '-r22.0' , "make " ]).whenComplete (() {
190
+ command = (runner.commands['make ' ] as ProductCommand );
195
191
});
196
192
expect (command.isReleaseValid, true );
197
193
});
198
194
test ('isReleaseValid partial version' , () async {
199
195
var runner = makeTestRunner ();
200
196
late ProductCommand command;
201
- await runner.run (["-d../.." , '-r22' , "build " ]).whenComplete (() {
202
- command = (runner.commands['build ' ] as ProductCommand );
197
+ await runner.run (["-d../.." , '-r22' , "make " ]).whenComplete (() {
198
+ command = (runner.commands['make ' ] as ProductCommand );
203
199
});
204
200
expect (command.isReleaseValid, true );
205
201
});
206
202
test ('isReleaseValid bad version' , () async {
207
203
var runner = makeTestRunner ();
208
204
late ProductCommand command;
209
- await runner.run (["-d../.." , '-r22.0.0' , "build " ]).whenComplete (() {
210
- command = (runner.commands['build ' ] as ProductCommand );
205
+ await runner.run (["-d../.." , '-r22.0.0' , "make " ]).whenComplete (() {
206
+ command = (runner.commands['make ' ] as ProductCommand );
211
207
});
212
208
expect (command.isReleaseValid, false );
213
209
});
@@ -216,24 +212,13 @@ void main() {
216
212
217
213
BuildCommandRunner makeTestRunner () {
218
214
var runner = BuildCommandRunner ();
219
- runner.addCommand (TestBuildCommand (runner));
220
215
runner.addCommand (TestMakeCommand (runner));
221
216
runner.addCommand (TestTestCommand (runner));
222
217
runner.addCommand (TestDeployCommand (runner));
223
218
runner.addCommand (TestGenCommand (runner));
224
219
return runner;
225
220
}
226
221
227
- class TestBuildCommand extends AntBuildCommand {
228
- TestBuildCommand (super .runner);
229
-
230
- @override
231
- bool get isTesting => true ;
232
-
233
- @override
234
- Future <int > doit () async => Future (() => 0 );
235
- }
236
-
237
222
class TestMakeCommand extends GradleBuildCommand {
238
223
TestMakeCommand (super .runner);
239
224
0 commit comments