Skip to content

Commit 3eeea3a

Browse files
committed
add support for Gradle version 7.2. see #103
1 parent f0b58ef commit 3eeea3a

File tree

7 files changed

+60
-29
lines changed

7 files changed

+60
-29
lines changed

.classpath

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<classpath>
3-
<classpathentry including="**/*.java" kind="src" output="bin/test" path="src">
4-
<attributes>
5-
<attribute name="test" value="true"/>
6-
<attribute name="gradle_scope" value="test"/>
7-
<attribute name="gradle_used_by_scope" value="test"/>
8-
</attributes>
9-
</classpathentry>
10-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
11-
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
12-
<classpathentry kind="output" path="bin/default"/>
13-
</classpath>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="bin/main" path="src">
4+
<attributes>
5+
<attribute name="gradle_scope" value="main"/>
6+
<attribute name="gradle_used_by_scope" value="main,test"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
10+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
11+
<classpathentry kind="output" path="bin/default"/>
12+
</classpath>

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
- LIB_GRADLE_VERSION=4.8 DEPLOY=true
1515
- LIB_GRADLE_VERSION=4.8.1
1616
- LIB_GRADLE_VERSION=4.10.2
17+
- LIB_GRADLE_VERSION=7.2
1718
global:
1819
# The next declaration is the encrypted gradlePublishKey
1920
- secure: tzRoJbjW38G0YcSRuf53+koo/ZixIrA1vHJ9StOfafZOJzKyoASkbFa2EpUKmp3CXBWvUSTVo59j7ywUSyWW+L+G+CRnYqkDTktySJ/LAHjR0CH5dJCUodwcwtZkBje/RQZ//ZuPO2I7wY/aqHfj/E8pg2h9Y+nOd2v9R904/5b5gck9nM1Tr74YE2dJDm3h0QKrMqx6/oT7KVTWQpTNeLxcdrdNn5yxllqn4YDF70gEksoSuJeFR2l5lwSlTTseKI7Q7mGYI1Tg/PSZoxlPz3DGFmSe+9sewRnN9ZnjQDEY06/GmrGQHGv9MV1azvenlFHrt9lIbHnEo0GBqxNpeFfMd4+B9oeEmL8roapNSq0TCgVvOzda/G5KyY8TgLEi+k7WrZaWGvbW+AorU5ntenWEzSWz3b5lpwnwXxrPyyRnaKd3R5mRYj+LL10hlHAiWpvXn+v6ptD2OunE6l3JEm+wln+6wZjJBqBhl1jsv3LOd5siezFGqqOzC6FN6UgkTZqsgMfROzoqklFv3Ko8fU4e6oo9VzI/cJGcFHFO4M+dOHyYZbKl8hfvi1Bf44UpYo914sdwmWGIAZ8J6V2xtCqTnyN1bi/EQuKAkE2400laduCt/rnGyR8IefcM6iFxjufR5jCXpXBhbQ0cQ//pUT0eW4ssjqKvt9RrJmt/Mew=
@@ -25,7 +26,8 @@ before_install:
2526
- sudo apt-get install -y fakeroot
2627
install:
2728
- gradle wrapper
28-
- ./gradlew uploadArchives
29+
# upload to '../repo'
30+
- ./gradlew publish
2931
deploy:
3032
provider: releases
3133
api_key:

build.gradle

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
apply plugin: 'java'
6-
apply plugin: 'maven'
6+
apply plugin: 'maven-publish'
77

88
apply from: "${buildscript.sourceFile.parentFile}/scripts/javapreprocessor.gradle"
99

@@ -31,7 +31,7 @@ repositories {
3131
}
3232

3333
dependencies {
34-
compile gradleApi()
34+
api gradleApi()
3535
}
3636

3737
sourceSets {
@@ -48,14 +48,6 @@ sourceSets {
4848
exclude '**/package.html'
4949
}
5050
}
51-
test {
52-
java {
53-
srcDirs = ['src']
54-
if ( !version.equalsIgnoreCase(baseVersion) ) {
55-
srcDirs = ["${buildDir}/preparedSrc-${gVersion}"]
56-
}
57-
}
58-
}
5951
}
6052

6153
/* Configure for ClearReports Version and copy files if needed */
@@ -79,13 +71,19 @@ if( !System.getProperty("local") && file( '../BuildScripts/base.gradle' ).exists
7971
} else {
8072
println "Uploading into local '../repo'"
8173
version += System.getenv('DEPLOY') != null ?'':'-SNAPSHOT' // setting version to snapshot
82-
uploadArchives {
74+
publishing {
75+
publications {
76+
mavenJava(MavenPublication) {
77+
from components.java
78+
}
79+
}
8380
repositories {
84-
mavenDeployer {
85-
repository(url: uri('../repo'))
81+
maven {
82+
url = '../repo'
8683
}
8784
}
8885
}
86+
publish.dependsOn 'assemble'
8987

9088
clean.doLast {
9189
println "Cleaning local repository folder"

scripts/SetupBuilderVersion.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ ext.setupBuilderVersion = { buildVersion = '+' ->
1414
if( gVersion >= VersionNumber.parse( '4.2' ) ) version = '4.2'
1515
if( gVersion >= VersionNumber.parse( '4.5' ) ) version = '4.5'
1616
if( gVersion >= VersionNumber.parse( '4.8' ) ) version = '4.8'
17+
if( gVersion >= VersionNumber.parse( '7.2' ) ) version = '7.2'
1718
return version + '.' + buildVersion
1819
}

scripts/javapreprocessor.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class JPPTask extends DefaultTask {
185185
getProject().getTasks().JPP.enabled = true
186186
}
187187

188+
@Input
188189
HashMap<String,HashMap<String, String>> getJPPSources() {
189190
return jppSources;
190191
}

src/com/inet/gradle/setup/abstracts/AbstractTask.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262

6363
import groovy.lang.Closure;
6464

65+
/*// if gradleVersion >= 7.0
66+
import org.gradle.api.internal.DocumentationRegistry;
67+
import org.gradle.api.model.ObjectFactory;
68+
*/// endif
69+
6570
/**
6671
* Base class for all setup task.
6772
*
@@ -176,9 +181,11 @@ private void processFiles( CopyActionProcessingStreamAction action, CopySpecInte
176181

177182
/*// if gradleVersion < 3.4
178183
CopyActionExecuter copyActionExecuter = new CopyActionExecuter( getInstantiator(), getFileSystem() );
179-
*/// else
184+
*/// elif gradleVersion < 7.2
180185
CopyActionExecuter copyActionExecuter = new CopyActionExecuter( getInstantiator(), getFileSystem(), true );
181-
//// endif
186+
/*// else
187+
CopyActionExecuter copyActionExecuter = new CopyActionExecuter( getInstantiator(), getObjectFactory(), getFileSystem(), true, getDocumentationRegistry() );
188+
*/// endif
182189

183190
CopyAction copyAction = new CopyAction() {
184191
@Override
@@ -214,6 +221,18 @@ protected FileLookup getFileLookup() {
214221
throw new UnsupportedOperationException();
215222
}
216223

224+
/*// if gradleVersion >= 7.0
225+
@Inject
226+
protected DocumentationRegistry getDocumentationRegistry() {
227+
throw new UnsupportedOperationException();
228+
}
229+
230+
@Inject
231+
protected ObjectFactory getObjectFactory() {
232+
throw new UnsupportedOperationException();
233+
}
234+
*/// endif
235+
217236
/**
218237
* The platform depending build.
219238
*/

src/com/inet/gradle/setup/abstracts/SetupSources.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
import org.gradle.api.Transformer;
3939
//// endif
4040

41+
/*//if gradleVersion >= 7.2
42+
import org.gradle.api.file.ExpandDetails;
43+
*///endif
44+
4145
/**
4246
* Implementation of the CopySpec interface.
4347
*
@@ -296,4 +300,11 @@ default CopySpec filesNotMatching( Iterable<String> arg0, Action<? super FileCop
296300
return getRootSpec().filesMatching( arg0, arg1 );
297301
}
298302
//// endif
303+
304+
/*// if gradleVersion >= 7.2
305+
@Override
306+
default CopySpec expand( Map<String,?> arg0, Action<? super ExpandDetails> arg1 ) {
307+
return getRootSpec().expand( arg0, arg1 );
308+
}
309+
*/// endif
299310
}

0 commit comments

Comments
 (0)