Skip to content

Commit 3975572

Browse files
committed
fixed compatibility with gradle 7, added tests
1 parent 2135935 commit 3975572

File tree

24 files changed

+447
-10
lines changed

24 files changed

+447
-10
lines changed

jcp-tests/jcp-test-android/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<id>gradle</id>
7575
<phase>compile</phase>
7676
<configuration>
77-
<executable>${gradle.executable}</executable>
77+
<executable>${gradle6.executable}</executable>
7878
<arguments>
7979
<argument>clean</argument>
8080
<argument>test</argument>
File renamed without changes.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<version>0-SNAPSHOT</version>
1010
</parent>
1111

12-
<artifactId>jcp-test-gradle</artifactId>
12+
<artifactId>jcp-test-gradle-5</artifactId>
1313
<packaging>pom</packaging>
1414

1515
<dependencies>
@@ -63,11 +63,12 @@
6363
<id>gradle</id>
6464
<phase>compile</phase>
6565
<configuration>
66-
<executable>${gradle.executable}</executable>
66+
<executable>${gradle5.executable}</executable>
6767
<arguments>
6868
<argument>clean</argument>
6969
<argument>test</argument>
7070
<argument>jar</argument>
71+
<argument>--rerun-tasks</argument>
7172
<argument>--scan</argument>
7273
<argument>--full-stacktrace</argument>
7374
<argument>
File renamed without changes.

jcp-tests/jcp-test-gradle/src/main/java/com/igormaznitsa/jcp/it/gradle/Main.java renamed to jcp-tests/jcp-test-gradle-5/src/main/java/com/igormaznitsa/jcp/it/gradle/Main.java

File renamed without changes.

jcp-tests/jcp-test-gradle/src/main/java/com/igormaznitsa/jcp/it/gradle/Some.java renamed to jcp-tests/jcp-test-gradle-5/src/main/java/com/igormaznitsa/jcp/it/gradle/Some.java

File renamed without changes.

jcp-tests/jcp-test-gradle/src/test/java/com/igormaznitsa/jcp/it/gradle/TestMain.java renamed to jcp-tests/jcp-test-gradle-5/src/test/java/com/igormaznitsa/jcp/it/gradle/TestMain.java

File renamed without changes.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
buildscript {
2+
repositories {
3+
flatDir dirs: "../../jcp/target"
4+
}
5+
dependencies {
6+
classpath "com.igormaznitsa:jcp:7.0.5-SNAPSHOT"
7+
}
8+
}
9+
10+
apply plugin: 'java'
11+
apply plugin: 'application'
12+
apply plugin: 'com.igormaznitsa.jcp'
13+
14+
mainClassName = 'hello.world'
15+
16+
sourceCompatibility = JavaVersion.VERSION_1_7
17+
targetCompatibility = JavaVersion.VERSION_1_7
18+
19+
repositories {
20+
mavenLocal()
21+
mavenCentral()
22+
}
23+
24+
dependencies {
25+
testCompile 'junit:junit:4.12'
26+
}
27+
28+
jar {
29+
manifest {
30+
attributes(
31+
'Main-Class': 'com.igormaznitsa.jcp.it.gradle.MainTwo'
32+
)
33+
}
34+
}
35+
36+
37+
preprocess {
38+
sources = sourceSets.main.java.srcDirs
39+
allowWhitespaces = true
40+
eol = '\r\n'
41+
keepAttributes = true
42+
sourceEncoding = 'UTF-8'
43+
targetEncoding = 'UTF-8'
44+
ignoreMissingSources = false
45+
excludeExtensions = ['txt', 'xml']
46+
fileExtensions = ['java']
47+
unknownVarAsFalse = false
48+
dryRun = false
49+
verbose = true
50+
clearTarget = true
51+
careForLastEol = true
52+
keepComments = true
53+
excludeFolders = ['**/some1', '**/some2']
54+
configFiles = ['./configFile.txt']
55+
keepLines = true
56+
allowWhitespaces = true
57+
preserveIndents = true
58+
dontOverwriteSameContent = false
59+
vars = ['some.test.global': 'Some Test Global Value']
60+
}
61+
task(changeSourceFolder) {
62+
sourceSets.main.java.srcDirs = [preprocess.target]
63+
}.dependsOn preprocess
64+
65+
66+
compileJava.dependsOn preprocess
67+
68+
gradle.buildFinished {
69+
println("Incoming preprocess files: " + preprocess.incomingFiles.size())
70+
println("Resulted preprocess files: " + preprocess.outcomingFiles.size())
71+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# config file for build
2+
someGlobalVar="HUZZAA!"

0 commit comments

Comments
 (0)