Skip to content

Commit

Permalink
chore(java11): Target Java 11 (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
plumpy authored Oct 8, 2020
1 parent 0b9eb38 commit 16a90a8
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 56 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Java 8 for cross-compilation support. Setting it up before
# Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/setup-java@v1
with:
java-version: 11
Expand All @@ -31,4 +26,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew -PenableCrossCompilerPlugin=true build --stacktrace
run: ./gradlew build --stacktrace
7 changes: 1 addition & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Install Java 8 for cross-compilation support. Setting it up before
# Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/setup-java@v1
with:
java-version: 11
Expand All @@ -25,4 +20,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew -PenableCrossCompilerPlugin=true build
run: ./gradlew build
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
# Install Java 8 for cross-compilation support. Setting it up before
# Java 11 means it comes later in $PATH (because of how setup-java works)
- uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/setup-java@v1
with:
java-version: 11
Expand All @@ -45,7 +40,7 @@ jobs:
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
RELEASE_VERSION: ${{ steps.release_info.outputs.RELEASE_VERSION }}
run: |
./gradlew -PenableCrossCompilerPlugin=true --info -Pversion="${RELEASE_VERSION}" -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" publish
./gradlew --info -Pversion="${RELEASE_VERSION}" -PbintrayUser="${BINTRAY_USER}" -PbintrayKey="${BINTRAY_API_KEY}" publish
- name: Create release
if: steps.release_info.outputs.SKIP_RELEASE == 'false'
uses: actions/create-release@v1
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile.compile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y \
openjdk-8-jdk \
openjdk-11-jdk \
&& rm -rf /var/lib/apt/lists/*
LABEL maintainer="sig-platform@spinnaker.io"
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
ENV JDK_18 /usr/lib/jvm/java-8-openjdk-amd64
ENV GRADLE_USER_HOME /workspace/.gradle
ENV GRADLE_OPTS -Xmx4g
CMD ./gradlew --no-daemon -PenableCrossCompilerPlugin=true igor-web:installDist -x test
CMD ./gradlew --no-daemon igor-web:installDist -x test
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ fiatVersion=1.26.0
korkVersion=7.77.0
org.gradle.parallel=true
spinnakerGradleVersion=8.9.0
targetJava11=true

# To enable a composite reference to a project, set the
# project property `'<projectName>Composite=true'`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public List<String> getJobNames(String master) {
}

public List<String> getTypeaheadResults(String search) {
List<String> results = new ArrayList<>();
var results = new ArrayList<String>();
redisClientDelegate.withKeyScan(
baseKey() + ":*:*:*" + search.toUpperCase() + "*:*",
1000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ class TravisBuildMonitorSpec extends Specification {
EchoService echoService = Mock()
TravisBuildMonitor travisBuildMonitor

final String MASTER = "MASTER"
final int CACHED_JOB_TTL_SECONDS = 172800
final int CACHED_JOB_TTL_DAYS = 2
String MASTER = "MASTER"
int CACHED_JOB_TTL_SECONDS = 172800
int CACHED_JOB_TTL_DAYS = 2

void setup() {
def travisProperties = new TravisProperties(cachedJobTTLDays: CACHED_JOB_TTL_DAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ class BuildCacheSpec extends Specification {
@Subject
BuildCache cache = new BuildCache(redisClientDelegate, new IgorConfigurationProperties())

final master = 'master'
final test = 'test'
final int TTL = 42
def master = 'master'
def test = 'test'
def int TTL = 42

void cleanup() {
embeddedRedis.pool.resource.withCloseable { Jedis resource ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ class BuildControllerSpec extends Specification {
@Shared
MockWebServer server

final SERVICE = 'SERVICE'
final JENKINS_SERVICE = 'JENKINS_SERVICE'
final TRAVIS_SERVICE = 'TRAVIS_SERVICE'
final HTTP_201 = 201
final BUILD_NUMBER = 123
final BUILD_ID = 654321
final QUEUED_JOB_NUMBER = 123456
final JOB_NAME = "job/name/can/have/slashes"
final PENDING_JOB_NAME = "pendingjob"
final FILE_NAME = "test.yml"
def SERVICE = 'SERVICE'
def JENKINS_SERVICE = 'JENKINS_SERVICE'
def TRAVIS_SERVICE = 'TRAVIS_SERVICE'
def HTTP_201 = 201
def BUILD_NUMBER = 123
def BUILD_ID = 654321
def QUEUED_JOB_NUMBER = 123456
def JOB_NAME = "job/name/can/have/slashes"
def PENDING_JOB_NAME = "pendingjob"
def FILE_NAME = "test.yml"

GenericBuild genericBuild

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class GitlabCiBuildMonitorSpec extends Specification {
EchoService echoService = Mock(EchoService)
GitlabCiBuildMonitor buildMonitor

final String MASTER = "MASTER"
final int CACHED_JOB_TTL_SECONDS = 172800
final int CACHED_JOB_TTL_DAYS = 2
String MASTER = "MASTER"
int CACHED_JOB_TTL_SECONDS = 172800
int CACHED_JOB_TTL_DAYS = 2

void setup() {
def properties = new GitlabCiProperties(cachedJobTTLDays: CACHED_JOB_TTL_DAYS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class JenkinsBuildMonitorSpec extends Specification {
IgorConfigurationProperties igorConfigurationProperties = new IgorConfigurationProperties()
JenkinsBuildMonitor monitor

final MASTER = 'MASTER'
def MASTER = 'MASTER'

void setup() {
def buildServices = new BuildServices()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class JenkinsCacheSpec extends Specification {
@Subject
JenkinsCache cache = new JenkinsCache(redisClientDelegate, new IgorConfigurationProperties())

final master = 'master'
final test = 'test'
def master = 'master'
def test = 'test'

void cleanup() {
embeddedRedis.pool.resource.withCloseable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import spock.lang.Unroll
@SuppressWarnings(['LineLength', 'DuplicateNumberLiteral'])
class JenkinsServiceSpec extends Specification {

final String JOB_UNENCODED = 'folder/job/name with spaces'
final String JOB_ENCODED = 'folder/job/name%20with%20spaces'
def String JOB_UNENCODED = 'folder/job/name with spaces'
def String JOB_ENCODED = 'folder/job/name%20with%20spaces'

@Shared
JenkinsClient client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ManagedDeliveryScmServiceSpec extends Specification {
ManagedDeliveryScmService service

StashClient client = Mock(StashClient)
final STASH_ADDRESS = "https://stash.com"
def STASH_ADDRESS = "https://stash.com"

ObjectMapper jsonMapper = new ObjectMapper()
ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CommitControllerSpec extends Specification {

BitBucketClient client = Mock(BitBucketClient)

final BITBUCKET_ADDRESS = "https://api.bitbucket.org"
def BITBUCKET_ADDRESS = "https://api.bitbucket.org"

void setup() {
controller = new CommitController(executor: Executors.newSingleThreadExecutor(), bitBucketMaster: new BitBucketMaster(bitBucketClient: client, baseUrl : BITBUCKET_ADDRESS), bitBucketProperties: new BitBucketProperties(commitDisplayLength: 7))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CommitControllerSpec extends Specification {

GitHubClient client = Mock(GitHubClient)

final GITHUB_ADDRESS = "https://github.com"
def GITHUB_ADDRESS = "https://github.com"

void setup() {
controller = new CommitController(executor: Executors.newSingleThreadExecutor(), master: new GitHubMaster(gitHubClient: client, baseUrl : GITHUB_ADDRESS), gitHubProperties: new GitHubProperties(commitDisplayLength: 8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CommitControllerSpec extends Specification {

GitLabClient client = Mock(GitLabClient)

final GITLAB_ADDRESS = "https://gitlab.com"
def GITLAB_ADDRESS = "https://gitlab.com"

void setup() {
def props = new GitLabProperties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CommitControllerSpec extends Specification {

StashClient client = Mock(StashClient)

final STASH_ADDRESS = "https://stash.com"
def STASH_ADDRESS = "https://stash.com"

void setup() {
controller = new CommitController(executor: Executors.newSingleThreadExecutor(), stashMaster: new StashMaster(stashClient: client, baseUrl : STASH_ADDRESS))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WerckerBuildMonitorSpec extends Specification {
new WerckerHost(name: master, address: werckerDev), cache, client, Permissions.EMPTY)
}

final MASTER = 'MASTER'
def MASTER = 'MASTER'

BuildServices mockBuildServices() {
BuildServices buildServices = new BuildServices()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class WerckerCacheSpec extends Specification {
@Subject
WerckerCache cache = new WerckerCache(redisClientDelegate, new IgorConfigurationProperties())

final master = 'testWerckerMaster'
final test = 'test'
final pipeline = 'myOrg/myApp/myTestPipeline'
def master = 'testWerckerMaster'
def test = 'test'
def pipeline = 'myOrg/myApp/myTestPipeline'

void cleanup() {
embeddedRedis.pool.resource.withCloseable { it.flushDB() }
Expand Down

0 comments on commit 16a90a8

Please sign in to comment.