Skip to content

Commit

Permalink
JDK-9ea build passes (locally)
Browse files Browse the repository at this point in the history
The following incompatibilities had to be disabled:
 - errorprone (gradle-errorprone-plugin/issues/27)
 - JavaDoc for simulator (akka/issues/21165)
 - Soft reference tests (JI-9042970)
 - OSGi tests (FELIX-5322)
 - Guava's tests

Not sure why CI hangs with Guava's test, as passes locally. Need to
investigate.
  • Loading branch information
ben-manes committed Aug 19, 2016
1 parent caf043f commit 8973141
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 176 deletions.
33 changes: 14 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
language: java
sudo: false

dist: trusty
group: edge

jdk:
- oraclejdk8
- oraclejdk9

before_install:
- if [[ "x$JDK" == *'x9'* ]]; then remove_dir_from_path $JAVA_HOME/bin; export JAVA_HOME=/usr/lib/jvm/java-9-oracle; export PATH=$JAVA_HOME/bin:$PATH; java -Xmx32m -version; fi
- cp gradle.properties.ci gradle.properties
- export JAVA_OPTS="-Xmx384m -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=0 -noverify"

install:
- ./gradlew assemble --stacktrace

before_script:
- export MAVEN_SKIP_RC=true
script:
- JAVA_OPTS="-Xmx384m -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=0 -noverify" ./gradlew check
- ./gradlew check
- sh -c 'cd examples/write-behind-rxjava && mvn test'

after_success:
- ./gradlew coveralls uploadArchives

matrix:
fast_finish: true
include:
- jdk: oraclejdk8 # this will be overwritten by before_install above
addons:
apt:
packages:
- oracle-java9-installer
env:
JDK=9
TERM=dumb
# Temporary disable JDK8
# - jdk: oraclejdk8
# env:
# TERM=dumb

# https://docs.travis-ci.com/user/languages/java/#Projects-Using-Gradle
allow_failures:
- jdk: oraclejdk9

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.m2
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Use Caffeine in a community provided integration:
* [ScalaCache][scala-cache]: Simple caching in Scala
* [Scaffeine][scaffeine]: Scala wrapper for Caffeine
* [Ratpack][ratpack]: Lean & powerful HTTP apps
* [Finagle][finagle]: Extensible RPC system
* [Druid][druid]: Real-time Analytics

### In the News

Expand All @@ -62,7 +64,6 @@ On the radar,
* Early discussions with [HBase][hbase], [Cassandra][cassandra], [Solr][solr], and [ElasticSearch][elastic-search]
* Postgres is [evaluating][postgres] whether to port the cache
* Go [implementation][go-tinylfu] of the W-TinyLfu policy
* [Druid][druid] has a caffeine powered extension

### Download

Expand Down Expand Up @@ -116,4 +117,5 @@ Snapshots of the development version are available in
[postgres]: https://www.mail-archive.com/[email protected]/msg274326.html
[go-tinylfu]: https://github.com/dgryski/go-tinylfu
[ratpack]: https://github.com/ratpack/ratpack
[druid]: https://github.com/druid-io/druid/pull/3028
[finagle]: https://github.com/twitter/finagle
[druid]: https://github.com/druid-io/druid
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ allprojects {
apply from: "${rootDir}/gradle/eclipse.gradle"

repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://jitpack.io' }
mavenCentral()
jcenter()
Expand All @@ -34,10 +35,6 @@ allprojects {
subprojects {
apply plugin: 'com.github.ethankhall.semantic-versioning'
apply plugin: 'nebula.provided-base'
if (!JavaVersion.current().isJava9Compatible()) {
// TODO: figure out which errorprone version supports JDK 9+
apply plugin: 'net.ltgt.errorprone'
}
apply plugin: 'java'
apply plugin: 'osgi'

Expand All @@ -46,6 +43,12 @@ subprojects {
apply from: "${rootDir}/gradle/dependencies.gradle"
apply from: "${rootDir}/gradle/object_layout.gradle"

if (JavaVersion.current().isJava9Compatible()) {
tasks.uploadArchives.enabled = false
} else {
apply plugin: 'net.ltgt.errorprone'
}

sourceCompatibility = JavaVersion.VERSION_1_8

group = 'com.github.ben-manes.caffeine'
Expand Down Expand Up @@ -137,5 +140,5 @@ tasks.coveralls {
description = 'Uploads the aggregated coverage report to Coveralls'

dependsOn jacocoRootReport
onlyIf { System.env.'CI' }
onlyIf { System.env.'CI' && !JavaVersion.current().isJava9Compatible() }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.github.benmanes.caffeine.cache.testing;

import static com.google.common.base.Predicates.equalTo;
import static com.google.common.base.Predicates.not;
import static org.mockito.Mockito.reset;

import java.util.Arrays;
Expand Down Expand Up @@ -86,6 +88,10 @@ private Set<List<Object>> combinations() {
Set<Implementation> implementations = filterTypes(
options.implementation(), cacheSpec.implementation());

if (System.getProperty("java.version").contains("9")) {
values = Sets.filter(values, not(equalTo(ReferenceType.SOFT)));
}

if (isAsyncLoadingOnly) {
values = values.contains(ReferenceType.STRONG)
? ImmutableSet.of(ReferenceType.STRONG)
Expand Down
2 changes: 2 additions & 0 deletions caffeine/testing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ task isolatedTests(type: Test, group: 'Cache tests') {
}

task osgiTests(type: Test, group: 'Cache tests', description: 'Isolated OSGi tests') {
enabled = !JavaVersion.current().isJava9Compatible()

useJUnit()
tasks.test.dependsOn(it)
systemProperty 'caffeine.osgi.jar', project(':caffeine').jar.archivePath.path
Expand Down
4 changes: 4 additions & 0 deletions gradle/code_quality.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ pmd {
ruleSetConfig = resources.text.fromFile(file("${rootDir}/config/pmd/rulesSets.xml"))
}

jacoco {
toolVersion = '0.7.8-SNAPSHOT'
}

jacocoTestReport {
group = 'Coverage reports'
description = 'Generates a test coverage report for a project'
Expand Down
4 changes: 2 additions & 2 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ext {
jcache_tck: '1.0.1',
jctools: '1.2.1',
junit: '4.12',
mockito: '2.0.100-beta',
mockito: '2.0.106-beta',
pax_exam: '4.9.1',
testng: '6.9.12',
truth: '0.24',
Expand All @@ -64,7 +64,7 @@ ext {
java_object_layout: '0.5',
koloboke: '0.6.8',
slf4j: '1.7.21',
tcache: '0.9.4',
tcache: '0.9.5',
]
plugin_versions = [
checkstyle: '7.1',
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-rc-2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
17 changes: 17 additions & 0 deletions guava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ tasks.withType(Javadoc) {
}

test {
useJUnit {
excludeCategories 'com.github.benmanes.caffeine.guava.OSGiTests'
}
}

task osgiTests(type: Test, group: 'Cache tests', description: 'Isolated OSGi tests') {
enabled = !JavaVersion.current().isJava9Compatible()
tasks.test.dependsOn(it)

useJUnit {
includeCategories 'com.github.benmanes.caffeine.guava.OSGiTests'
}
}

tasks.withType(Test) {
enabled = !JavaVersion.current().isJava9Compatible()

systemProperty 'guava.osgi.version', versions.guava
systemProperty 'caffeine.osgi.jar', project(':caffeine').jar.archivePath.path
systemProperty 'caffeine-guava.osgi.jar', project(':guava').jar.archivePath.path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import static org.ops4j.pax.exam.CoreOptions.options;

import org.junit.Test;
import org.junit.experimental.categories.Categories.IncludeCategory;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
Expand All @@ -37,6 +39,7 @@
* @author [email protected] (Ben Manes)
*/
@RunWith(PaxExam.class)
@IncludeCategory(OSGiTests.class)
@ExamReactorStrategy(PerMethod.class)
public final class OSGiTest {

Expand All @@ -50,6 +53,7 @@ public Option[] config() {
}

@Test
@Category(OSGiTests.class)
public void sanity() {
CacheLoader<Integer, Integer> loader = new CacheLoader<Integer, Integer>() {
@Override public Integer load(Integer key) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2016 Ben Manes. All Rights Reserved.
*
* 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 com.github.benmanes.caffeine.guava;

/**
* @author [email protected] (Ben Manes)
*/
public interface OSGiTests {}
Loading

0 comments on commit 8973141

Please sign in to comment.