Skip to content

Commit

Permalink
chore(java11): Target Java 11 (#3953)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfieber committed Oct 7, 2020
1 parent 07dfd37 commit fe3248e
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 51 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
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
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
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
@@ -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 -Xmx6g
CMD ./gradlew --no-daemon -PenableCrossCompilerPlugin=true orca-web:installDist -x test
CMD ./gradlew --no-daemon orca-web:installDist -x test
3 changes: 1 addition & 2 deletions gradle.properties
@@ -1,10 +1,9 @@
enablePublishing=false
fiatVersion=1.26.0
korkVersion=7.76.3
keikoVersion=3.9.0
kotlinVersion=1.3.72
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
4 changes: 2 additions & 2 deletions gradle/kotlin.gradle
Expand Up @@ -21,14 +21,14 @@ apply plugin: "io.gitlab.arturbosch.detekt"
compileKotlin {
kotlinOptions {
languageVersion = "1.3"
jvmTarget = "1.8"
jvmTarget = "11"
}
}

compileTestKotlin {
kotlinOptions {
languageVersion = "1.3"
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down
Expand Up @@ -39,12 +39,12 @@ class BakeryServiceSpec extends Specification {

@Subject BakeryService bakery

final region = "us-west-1"
final bake = BakeRequest.Default.copyWith(user: "rfletcher", packageName: "orca")
final bakePath = "/api/v1/$region/bake"
final statusPath = "/api/v1/$region/status"
final bakeId = "b-123456789"
final statusId = "s-123456789"
private static final region = "us-west-1"
private static final bake = BakeRequest.Default.copyWith(user: "rfletcher", packageName: "orca")
private static final bakePath = "/api/v1/$region/bake"
private static final statusPath = "/api/v1/$region/status"
private static final bakeId = "b-123456789"
private static final statusId = "s-123456789"

String bakeURI
String statusURI
Expand Down
Expand Up @@ -55,7 +55,7 @@ class KatoRestServiceSpec extends Specification {

def mapper = OrcaObjectMapper.newInstance()

final taskId = "e1jbn3"
private static final taskId = "e1jbn3"

def setup() {
def cfg = new CloudDriverConfiguration()
Expand Down
Expand Up @@ -25,7 +25,7 @@ import spock.lang.Subject
class CheckForRemainingPipelinesTaskSpec extends Specification {

@Subject
final task = new CheckForRemainingPipelinesTask()
def task = new CheckForRemainingPipelinesTask()

void 'keep looping to save more tasks'() {
when:
Expand Down
Expand Up @@ -26,10 +26,10 @@ import spock.lang.Subject

class CheckPipelineResultsTaskSpec extends Specification {

final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()
private static final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()

@Subject
final task = new CheckPipelineResultsTask(objectMapper)
def task = new CheckPipelineResultsTask(objectMapper)

void 'add created pipeline success to context'() {
when:
Expand Down
Expand Up @@ -31,13 +31,13 @@ import spock.lang.Subject

class GetPipelinesFromArtifactTaskSpec extends Specification {

final Front50Service front50Service = Mock()
final OortService oortService = Mock()
final ArtifactUtils artifactUtils = Mock()
final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()
Front50Service front50Service = Mock()
OortService oortService = Mock()
ArtifactUtils artifactUtils = Mock()
private static final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()

@Subject
final task = new GetPipelinesFromArtifactTask(front50Service, oortService, objectMapper, artifactUtils)
def task = new GetPipelinesFromArtifactTask(front50Service, oortService, objectMapper, artifactUtils)

void 'extract pipelines JSON from artifact'() {
when:
Expand Down Expand Up @@ -94,7 +94,7 @@ class GetPipelinesFromArtifactTaskSpec extends Specification {
ex.message == "No artifact could be bound to '123'"
}

final pipelineJson = '''
private static final pipelineJson = '''
{
"app1": [{
"name": "just waiting",
Expand Down
Expand Up @@ -25,10 +25,10 @@ import spock.lang.Subject

class PreparePipelineToSaveTaskSpec extends Specification {

final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()
private static final ObjectMapper objectMapper = OrcaObjectMapper.newInstance()

@Subject
final task = new PreparePipelineToSaveTask(objectMapper)
def task = new PreparePipelineToSaveTask(objectMapper)

void 'prepare pipeline for save pipeline task'() {
when:
Expand Down
Expand Up @@ -51,7 +51,7 @@ public TaskResolver(ObjectProvider<Collection<Task>> tasksProvider) {
public TaskResolver(ObjectProvider<Collection<Task>> tasksProvider, boolean allowFallback) {
this.allowFallback = allowFallback;
this.tasksProvider = tasksProvider;
Collection<Task> tasks = tasksProvider.getIfAvailable(ArrayList::new);
var tasks = tasksProvider.getIfAvailable(ArrayList::new);
for (Task task : tasks) {
taskByAlias.put(task.getExtensionClass().getCanonicalName(), task);
addAliases(task);
Expand Down
Expand Up @@ -23,12 +23,12 @@ class BuildServiceSpec extends Specification {
BuildService buildService
IgorService igorService

final MASTER = 'MASTER'
final BUILD_NUMBER = 123
final JOB_NAME = "name/with/slashes and spaces"
final JOB_NAME_ENCODED = "name/with/slashes%20and%20spaces"
final PARAMS = ['key': 'value']
final FILENAME = 'file.txt'
private static final MASTER = 'MASTER'
private static final BUILD_NUMBER = 123
private static final JOB_NAME = "name/with/slashes and spaces"
private static final JOB_NAME_ENCODED = "name/with/slashes%20and%20spaces"
private static final PARAMS = ['key': 'value']
private static final FILENAME = 'file.txt'

void setup() {
igorService = Mock(IgorService)
Expand Down

0 comments on commit fe3248e

Please sign in to comment.