Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Multi-Release Jar #345

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: java
jdk:
- openjdk8
- openjdk11

# whitelist
branches:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ You can also depend on latest snapshot from this repository (live on the edge) b

Build it from source
==========
JCTools is maven built and requires an existing Maven installation and JDK8 (only for building, runtime is 1.6 compliant).
JCTools is maven built and requires an existing Maven installation and JDK11 (only for building, runtime is 1.6 compliant).

With 'MAVEN_HOME/bin' on the path and JDK8 set to your 'JAVA_HOME' you should be able to run "mvn install" from this
With 'MAVEN_HOME/bin' on the path and JDK11 set to your 'JAVA_HOME' you should be able to run "mvn install" from this
directory.


Expand Down
24 changes: 23 additions & 1 deletion jctools-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>compile-java11</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>${java.multi-release.version}</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java${java.multi-release.version}</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -66,11 +86,12 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.2.1</version>
<version>5.1.2</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>sun.misc;resolution:=optional</Import-Package>
<Export-Package>org.jctools.*</Export-Package>
</instructions>
</configuration>
</plugin>
Expand Down Expand Up @@ -122,6 +143,7 @@
<archive>
<manifestEntries>
<Automatic-Module-Name>org.jctools.core</Automatic-Module-Name>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
Expand Down
25 changes: 25 additions & 0 deletions jctools-core/src/main/java/org/jctools/util/ThreadUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jctools.util;

@InternalAPI
public final class ThreadUtil {

private ThreadUtil() {}

public static void onSpinWait() {

}

}
6 changes: 6 additions & 0 deletions jctools-core/src/main/java11/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module org.jctools.core {
exports org.jctools.counters;
exports org.jctools.maps;
exports org.jctools.queues;
exports org.jctools.util;
}
25 changes: 25 additions & 0 deletions jctools-core/src/main/java11/org/jctools/util/ThreadUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jctools.util;

@InternalAPI
public final class ThreadUtil {

private ThreadUtil() {}

public static void onSpinWait() {
Thread.onSpinWait();
}

}
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.6</java.version>
<java.test.version>1.8</java.test.version>
<java.multi-release.version>11</java.multi-release.version>

<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand Down Expand Up @@ -98,7 +99,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>${java.test.version}</version>
<version>${java.multi-release.version}</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down