86
86
libsDirName = " jar"
87
87
}
88
88
89
- project. tasks. withType(JavaCompile ) {
89
+ project. tasks. withType(JavaCompile ). configureEach {
90
90
sourceCompatibility = project. ext. sourceCompatibility
91
91
targetCompatibility = project. ext. targetCompatibility
92
92
}
@@ -95,45 +95,46 @@ project.tasks.withType(JavaCompile) {
95
95
// artifacts. Its extension is .module, which might get confused with our own .module files.
96
96
// We could publish these files for everything but .module files, but for now we disable always
97
97
// https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html
98
- project. tasks. withType(GenerateModuleMetadata ) {
98
+ project. tasks. withType(GenerateModuleMetadata ). configureEach {
99
99
enabled = false
100
100
}
101
101
102
- project. task(" fatJar" ,
103
- description : " Generate single jar file containing the api and all its dependent classes" ,
104
- group : GroupNames . BUILD ,
105
- type : Jar ,
106
- {
107
- Jar jar ->
108
- jar. from sourceSets. main. output
109
- jar. duplicatesStrategy = DuplicatesStrategy . EXCLUDE
110
- jar. from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) }}
111
- jar. setArchiveVersion(project. version)
112
- jar. archiveClassifier. set(LabKey . FAT_JAR_CLASSIFIER )
113
- jar. dependsOn project. tasks. jar
114
- }
115
- )
102
+ project. tasks. register(" fatJar" , Jar ) {
103
+ Jar jar ->
104
+ jar. description = " Generate single jar file containing the api and all its dependent classes"
105
+ jar. group = GroupNames . BUILD
106
+ jar. from sourceSets. main. output
107
+ jar. duplicatesStrategy = DuplicatesStrategy . EXCLUDE
108
+ jar. from { configurations. runtimeClasspath. collect { it. isDirectory() ? it : zipTree(it) } }
109
+ jar. setArchiveVersion(project. version)
110
+ jar. archiveClassifier. set(LabKey . FAT_JAR_CLASSIFIER )
111
+ jar. dependsOn project. tasks. jar
112
+ }
116
113
117
114
if (project. hasProperty(' javaClientDir' ))
118
115
{
119
- project. task (' deployFatJar' , description : " Generate java client 'all' jar file and deploy to a given directory. For example, a host app other than LabKey Server " ,
120
- type : Copy ) {
116
+ project. tasks . register (' deployFatJar' , Copy ) {
117
+ description = " Generate java client 'all' jar file and deploy to a given directory. For example, a host app other than LabKey Server "
121
118
from fatJar
122
119
into project. javaClientDir
123
120
}
124
121
}
125
122
126
- project. task(' javadocJar' , description : " Generate jar file of javadoc files" , type : Jar ) {Jar jar ->
127
- jar. from project. tasks. javadoc. destinationDir
128
- jar. group GroupNames . DISTRIBUTION
129
- jar. archiveClassifier. set(LabKey . JAVADOC_CLASSIFIER )
130
- jar. dependsOn project. tasks. javadoc
131
- }
123
+ project. tasks. register(' javadocJar' , Jar ) {
124
+ Jar jar ->
125
+ jar. description = " Generate jar file of javadoc files"
126
+ jar. from project. tasks. javadoc. destinationDir
127
+ jar. group GroupNames . DISTRIBUTION
128
+ jar. archiveClassifier. set(LabKey . JAVADOC_CLASSIFIER )
129
+ jar. dependsOn project. tasks. javadoc
130
+ }
132
131
133
- project. task(' sourcesJar' , description : " Generate jar file of source files" , type : Jar ) {Jar jar ->
134
- jar. from project. sourceSets. main. allJava
135
- jar. group GroupNames . DISTRIBUTION
136
- jar. archiveClassifier. set(LabKey . SOURCES_CLASSIFIER )
132
+ project. tasks. register(' sourcesJar' , Jar ) {
133
+ Jar jar ->
134
+ jar. description = " Generate jar file of source files"
135
+ jar. from project. sourceSets. main. allJava
136
+ jar. group GroupNames . DISTRIBUTION
137
+ jar. archiveClassifier. set(LabKey . SOURCES_CLASSIFIER )
137
138
}
138
139
139
140
project. artifacts {
0 commit comments