Skip to content

Commit 788da2c

Browse files
committed
Requires gradle 4+
1 parent 6ca095e commit 788da2c

File tree

10 files changed

+72
-20
lines changed

10 files changed

+72
-20
lines changed

flapi-build-plugin/src/main/java/unquietcode/tools/flapi/plugin/FlapiBuildPlugin.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*********************************************************************
2-
Copyright 2014 the Flapi authors
2+
Copyright 2018 the Flapi authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
4343
*/
4444
@Mojo(
4545
name="generate",
46-
defaultPhase=LifecyclePhase.PROCESS_TEST_CLASSES,
47-
requiresDependencyResolution=ResolutionScope.TEST
46+
defaultPhase=LifecyclePhase.PROCESS_CLASSES,
47+
requiresDependencyResolution=ResolutionScope.COMPILE
4848
)
4949
public class FlapiBuildPlugin extends AbstractMojo {
5050

flapi-build-project/pom.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@
7474
</repository>
7575
</distributionManagement>
7676

77+
<dependencies>
78+
<dependency>
79+
<groupId>com.unquietcode.tools.flapi</groupId>
80+
<artifactId>flapi</artifactId>
81+
<version>${project.version}</version>
82+
<scope>provided</scope>
83+
</dependency>
84+
</dependencies>
85+
7786
<profiles>
7887
<profile>
7988
<id>gpg</id>
@@ -191,7 +200,7 @@
191200
<goals>
192201
<goal>add-source</goal>
193202
</goals>
194-
<phase>generate-test-sources</phase>
203+
<phase>process-classes</phase>
195204
<configuration>
196205
<sources>
197206
<source>${flapi.generated.sources}</source>
@@ -202,4 +211,4 @@
202211
</plugin>
203212
</plugins>
204213
</build>
205-
</project>
214+
</project>

flapi-build-test-consumer/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ group = 'com.unquietcode.tools.flapi.test'
55
version = '0.0-DEVELOPMENT'
66
sourceCompatibility = '1.8'
77

8+
install.dependsOn test
9+
810
repositories {
911
mavenCentral()
1012
mavenLocal()
1113
}
1214

1315
dependencies {
14-
compile 'com.unquietcode.tools.flapi.test:flapi-gradle-test-producer:0.0-DEVELOPMENT'
15-
testCompile 'junit:junit:4.11'
16+
implementation 'com.unquietcode.tools.flapi.test:flapi-gradle-test-producer:0.0-DEVELOPMENT'
17+
testImplementation 'junit:junit:4.11'
1618
}

flapi-build-test-consumer/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<plugin>
2525
<groupId>org.apache.maven.plugins</groupId>
2626
<artifactId>maven-deploy-plugin</artifactId>
27+
<version>2.8.2</version>
2728
<configuration>
2829
<skip>true</skip>
2930
</configuration>

flapi-build-test-producer/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ repositories {
2727
}
2828

2929
dependencies {
30+
compileOnly 'com.unquietcode.tools.flapi:flapi:0.0-DEVELOPMENT'
3031
testCompile 'com.unquietcode.tools.flapi:flapi:0.0-DEVELOPMENT'
3132
}
3233

flapi-build-test-producer/pom.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,17 @@
2121
<flapi.includeRuntime>true</flapi.includeRuntime>
2222
</properties>
2323

24-
<dependencies>
25-
<dependency>
26-
<groupId>com.unquietcode.tools.flapi</groupId>
27-
<artifactId>flapi</artifactId>
28-
<version>${project.version}</version>
29-
<scope>test</scope>
30-
</dependency>
31-
</dependencies>
32-
3324
<build>
3425
<plugins>
3526
<plugin>
3627
<groupId>org.apache.maven.plugins</groupId>
3728
<artifactId>maven-deploy-plugin</artifactId>
29+
<version>2.8.2</version>
3830
<configuration>
3931
<skip>true</skip>
4032
</configuration>
4133
</plugin>
4234
</plugins>
4335
</build>
4436

45-
</project>
37+
</project>

flapi-build-test-producer/src/test/java/unquietcode/tools/flapi/plugin/TestDescriptor.java renamed to flapi-build-test-producer/src/main/java/unquietcode/tools/flapi/plugin/TestDescriptor.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*********************************************************************
2+
Copyright 2018 the Flapi authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a basicCopy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
********************************************************************/
16+
117
package unquietcode.tools.flapi.plugin;
218

319
import unquietcode.tools.flapi.Descriptor;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*********************************************************************
2+
Copyright 2018 the Flapi authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a basicCopy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
********************************************************************/
16+
17+
package unquietcode.tools.flapi.plugin;
18+
19+
import unquietcode.tools.flapi.Descriptor;
20+
21+
/**
22+
* @author Ben Fagin
23+
* @version 2018-05-13
24+
*/
25+
public class TestDescriptorTest {
26+
27+
public static void main(String[] args) {
28+
Descriptor descriptor = new TestDescriptor().descriptor();
29+
descriptor.writeToStream(System.out);
30+
}
31+
}

flapi-gradle-plugin/src/main/groovy/unquietcode/tools/flapi/plugin/GradlePlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class GradlePlugin implements Plugin<Project> {
9090
List<URL> urls = new ArrayList<>();
9191

9292
// dependencies
93-
for (def path : project.configurations['testCompile']) {
93+
for (def path : project.configurations['compile']) {
9494
urls.add(path.toURI().toURL())
9595
}
9696

flapi-plugin/src/main/java/unquietcode/tools/flapi/plugin/PluginHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ else if (descriptor instanceof Class) {
125125

126126
// handle DescriptorMaker instances
127127
else if (DescriptorMaker.class.isAssignableFrom(descriptor.getClass())) {
128-
logInfo("processing descriptor");
128+
logInfo("processing descriptor "+descriptor.getClass().getName());
129129
processDescriptor(classloader(), (DescriptorMaker) descriptor);
130130
}
131131

132132
// handle Descriptor instances
133133
else if (Descriptor.class.isAssignableFrom(descriptor.getClass())) {
134-
logInfo("processing descriptor");
134+
logInfo("processing descriptor "+descriptor.getClass().getName());
135135
processDescriptor(classloader(), (Descriptor) descriptor);
136136
}
137137

0 commit comments

Comments
 (0)