Skip to content

Commit 1ceaf62

Browse files
committed
Fixes multiple issues:
- #34 migrates over to Github Actions - #35 set Java source compatibility back to 11 - #36 updated Gradle to 6.8.3 - #37 made java module - #39 use the application plugin - #40 removed Sources and Javadoc JAR tasks
1 parent 7da7355 commit 1ceaf62

File tree

11 files changed

+89
-67
lines changed

11 files changed

+89
-67
lines changed

.github/workflows/gradle.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
jobs:
16+
build:
17+
name: ${{ matrix.os }} / OpenJDK ${{ matrix.jdk }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
matrix:
21+
jdk: ['11', '15']
22+
os: [ubuntu-latest, windows-latest, macOS-latest]
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Set up JDK ${{ matrix.jdk }}
27+
uses: actions/setup-java@v1
28+
with:
29+
java-version: ${{ matrix.jdk }}
30+
- name: Grant execute permission for gradlew
31+
run: chmod +x gradlew
32+
- name: Build with Gradle
33+
run: ./gradlew build

.travis.yml

-12
This file was deleted.

README.adoc

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
Patrick Reinhart <https://github.com/reinhapa[@reinhapa]>
33
:project-name: jsplitpkgscan
44
:group-name: org.adoptopenjdk
5+
:jsplitpkgscan-version: 1.1.0-SNAPSHOT
56
:project-full-path: AdoptOpenJDK/{project-name}
67
:github-branch: master
7-
:jdk-version: 12
8+
:jdk-version: 11
89
:jdk-url: https://jdk.java.net/{jdk-version}
910
:adoptopenjdk-url: https://adoptopenjdk.net
1011

1112
image:https://img.shields.io/badge/license-GPL2+CPE-blue.svg["GNU General Public License, version 2, with the Classpath Exception", link="https://github.com/{project-full-path}/blob/{github-branch}/LICENSE"]
1213
image:https://img.shields.io/badge/Java-{jdk-version}-blue.svg["Supported Versions", link="https://travis-ci.org/{project-full-path}"]
13-
image:https://img.shields.io/travis/{project-full-path}/{github-branch}.svg["Build Status", link="https://travis-ci.org/{project-full-path}"]
14+
image:https://github.com/{project-full-path}/workflows/Java%20CI/badge.svg["Java CI with Gradle", link="https://github.com/{project-full-path}/actions?query=workflow%3ACI"]
1415
image:https://img.shields.io/maven-central/v/{group-name}/{project-name}.svg?label=Maven%20Central["Maven Central", link="https://search.maven.org/search?q=g:%22{group-name}%22%20AND%20a:%22{project-name}%22"]
1516

1617
This project contains a proposal for http://openjdk.java.net[OpenJDK] split package scanner addition.
@@ -34,11 +35,11 @@ To build use:
3435
./gradlew clean build
3536
----
3637

37-
After the build was sucessful you can now start it using:
38+
After the build was successful you can now start it using:
3839

39-
[source, bash]
40+
[source, bash, subs="attributes"]
4041
----
41-
java -p build/libs -m jsplitpkgscan
42+
java -p build/libs/jsplitpkgscan-{jsplitpkgscan-version}.jar -m org.adoptopenjdk.jsplitpkgscan
4243
----
4344

4445
The usage is as follows

build.gradle

+14-43
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
plugins {
2-
id 'java-library'
2+
id 'application'
33
id 'signing'
44
id 'maven-publish'
5-
id 'com.github.ben-manes.versions' version '0.21.0'
6-
id 'net.nemerosa.versioning' version '2.8.2'
7-
id 'org.gradle.java.experimental-jigsaw' version '0.1.1'
8-
id 'org.owasp.dependencycheck' version '5.1.0'
5+
id 'com.github.ben-manes.versions' version '0.36.0'
6+
id 'net.nemerosa.versioning' version '2.14.0'
7+
id 'org.owasp.dependencycheck' version '6.1.1'
98
}
109

1110
group = 'org.adoptopenjdk'
1211

13-
ext.mainClassName = 'jdk.Main'
14-
javaModule.name = 'jsplitpkgscan'
12+
java {
13+
modularity.inferModulePath = true
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
withJavadocJar()
16+
withSourcesJar()
17+
}
1518

16-
sourceCompatibility = 12
17-
targetCompatibility = 12
19+
application {
20+
mainClass = "jdk.Main"
21+
mainModule = "org.adoptopenjdk.jsplitpkgscan"
22+
}
1823

1924
// Uncomment the section below if you want to just ./gradlew publishToMavenLocal locally
2025
/*
@@ -25,45 +30,13 @@ repositories {
2530

2631
jar {
2732
manifest {
28-
attributes 'Main-Class': mainClassName,
29-
'Automatic-Module-Name': 'org.adoptopenjdk.jsplitpkgscan'
3033
metaInf {
3134
from file('.')
3235
include 'LICENSE'
3336
}
3437
}
3538
}
3639

37-
jar.doLast {
38-
// temporary work around to enable main class
39-
// using the jar executable
40-
exec {
41-
commandLine System.properties['java.home'] + '/bin/jar',
42-
'--update',
43-
'--main-class',
44-
mainClassName,
45-
'--file',
46-
jar.archivePath
47-
}
48-
}
49-
50-
task sourcesJar(type: Jar) {
51-
classifier 'sources'
52-
destinationDir file("${project.buildDir}/libs_other")
53-
from sourceSets.main.allSource
54-
}
55-
56-
task javadocJar(type: Jar, dependsOn: javadoc) {
57-
classifier 'javadoc'
58-
destinationDir file("${project.buildDir}/libs_other")
59-
from javadoc.destinationDir
60-
}
61-
62-
artifacts {
63-
archives sourcesJar
64-
archives javadocJar
65-
}
66-
6740
signing {
6841
required { project.hasProperty('signing.password') && !project.version.contains('-SNAPSHOT') }
6942
sign configurations.archives
@@ -77,8 +50,6 @@ publishing {
7750
publications {
7851
mavenJava(MavenPublication) {
7952
from components.java
80-
artifact sourcesJar
81-
artifact javadocJar
8253
pom {
8354
name = 'Split package scanner'
8455
description = 'Tool to scan existing JAR/WAR files for split packages'

gradle.properties

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# override from command line with -Pversion=x.y.z
22
version = 1.1.0-SNAPSHOT
3-
sourceCompatibility = 11
4-
targetCompatibility = 11
53

64
org.gradle.jvmargs=-ea -Xmx1G

gradle/wrapper/gradle-wrapper.jar

426 Bytes
Binary file not shown.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"

gradlew.bat

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

src/main/java/module-info.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module jsplitpkgscan {
1+
module org.adoptopenjdk.jsplitpkgscan {
22
requires java.compiler;
33
provides java.util.spi.ToolProvider
44
with jdk.Main.JsplitpgkscanToolProvider;

src/main/resources/META-INF/services/javax.tools.Tool

-1
This file was deleted.

0 commit comments

Comments
 (0)