Skip to content

Commit 760217a

Browse files
committed
Adding picocli-core-module
Addong a JMPS 9 compliant (hopefully) subproject. This subproject needs the root project to work as source files are copied to this subproject before compilation. It assumes that tests are run from the root project and not against this subproject, the objective being only to release a compliant Java 9 JPMS module.
1 parent b4ee2ca commit 760217a

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

picocli-core-module/build.gradle

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id 'java'
3+
id 'distribution'
4+
id 'maven-publish'
5+
id 'com.jfrog.bintray'
6+
id 'java-library'
7+
}
8+
9+
group 'info.picocli'
10+
description 'Picocli JPMS module.'
11+
version "$projectVersion"
12+
ext.moduleName = 'info.picocli'
13+
sourceCompatibility = JavaVersion.VERSION_1_9
14+
targetCompatibility = JavaVersion.VERSION_1_9
15+
16+
task copyRootProjectCode(type: Copy) {
17+
from("${rootProject.projectDir}/src/main/java"){
18+
exclude '**/groovy'
19+
}
20+
into "${projectDir}/src/main/java"
21+
}
22+
23+
compileJava {
24+
inputs.property("moduleName", moduleName)
25+
doFirst {
26+
options.compilerArgs = [
27+
'--module-path', classpath.asPath,
28+
]
29+
classpath = files()
30+
}
31+
}
32+
33+
test {
34+
// Excluding unit tests, should have been generated already with the root project.
35+
exclude 'picocli'
36+
}
37+
38+
task fatJar(type: Jar) {
39+
manifest {
40+
attributes 'Implementation-Title': 'Gradle Jar File Example',
41+
'Implementation-Version': version
42+
}
43+
baseName = project.name + '-all'
44+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
45+
with jar
46+
}
47+
48+
compileJava.dependsOn(copyRootProjectCode)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2017 Remko Popma
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 copy 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+
module info.picocli {
18+
exports picocli;
19+
}

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include 'picocli-examples'
33
include 'picocli-shell-jline2'
44
include 'picocli-shell-jline3'
55
include 'picocli-codegen'
6+
include 'picocli-core-module'
67

78
if (org.gradle.api.JavaVersion.current().isJava8Compatible() && !org.gradle.api.JavaVersion.current().isJava9Compatible()) {
89
include 'picocli-annotation-processing-tests'

0 commit comments

Comments
 (0)