Skip to content

Commit

Permalink
fix(build): Fixes for build failures when 'targetJava11=true' (spinna…
Browse files Browse the repository at this point in the history
  • Loading branch information
ajordens authored Sep 29, 2020
1 parent f8be6e9 commit 4b23103
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 54 deletions.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ front50Version=2.21.0
korkVersion=7.68.0
org.gradle.parallel=true
spinnakerGradleVersion=8.7.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 @@ -20,11 +20,11 @@ import com.netflix.spinnaker.halyard.core.error.v1.HalException
import spock.lang.Specification

class AccountServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final String PROVIDER = "kubernetes"
final String PROVIDER2 = "google"
final String ACCOUNT_NAME = "my-account"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
String PROVIDER = "kubernetes"
String PROVIDER2 = "google"
String ACCOUNT_NAME = "my-account"
HalconfigParserMocker mocker = new HalconfigParserMocker()

AccountService makeAccountService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException
import spock.lang.Specification

class ArtifactTemplateServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()

LookupService getMockLookupService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package com.netflix.spinnaker.halyard.config.services.v1
import spock.lang.Specification

class ConfigServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()

ConfigService makeConfigService(String config) {
def configService = new ConfigService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package com.netflix.spinnaker.halyard.config.services.v1
import spock.lang.Specification

class FeaturesServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()

FeaturesService makeFeaturesService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import com.netflix.spinnaker.halyard.config.model.v1.node.Provider
import spock.lang.Specification

class LookupServiceSpec extends Specification {
final static String DEPLOYMENT_NAME = "default"
final static String KUBERNETES_ACCOUNT_NAME = "my-k8s-account"
final static String DOCKER_REGISTRY_ACCOUNT_NAME = "my-docker-account"
final static String GOOGLE_ACCOUNT_NAME = "my-google-account"
final static String KUBERNETES_PROVIDER = "kubernetes"
final static String DOCKER_REGISTRY_PROVIDER = "dockerRegistry"
final static String GOOGLE_PROVIDER = "google"
final static String AZURE_ACCOUNT_NAME = "my-azure-account"
final static String AZURE_PROVIDER = "azure"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
static String DEPLOYMENT_NAME = "default"
static String KUBERNETES_ACCOUNT_NAME = "my-k8s-account"
static String DOCKER_REGISTRY_ACCOUNT_NAME = "my-docker-account"
static String GOOGLE_ACCOUNT_NAME = "my-google-account"
static String KUBERNETES_PROVIDER = "kubernetes"
static String DOCKER_REGISTRY_PROVIDER = "dockerRegistry"
static String GOOGLE_PROVIDER = "google"
static String AZURE_ACCOUNT_NAME = "my-azure-account"
static String AZURE_PROVIDER = "azure"
HalconfigParserMocker mocker = new HalconfigParserMocker()

def "find a kubernetes account"() {
setup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.GcsPersis
import spock.lang.Specification

class PersistentStorageServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final String PROJECT = "my-project"
final String STORE_NAME = "gcs"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
String PROJECT = "my-project"
String STORE_NAME = "gcs"
HalconfigParserMocker mocker = new HalconfigParserMocker()

PersistentStorageService makePersistentStorageService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException
import spock.lang.Specification

class PluginRepositoryServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()

LookupService getMockLookupService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException
import spock.lang.Specification

class PluginServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()

LookupService getMockLookupService(String config) {
def lookupService = new LookupService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import com.netflix.spinnaker.halyard.config.validate.v1.ValidatorCollection
import spock.lang.Specification

class ValidateServiceSpec extends Specification {
final static String DEPLOYMENT_NAME = "default"
final static String KUBERNETES_ACCOUNT_NAME = "my-k8s-account"
final static String DOCKER_REGISTRY_ACCOUNT_NAME = "my-docker-account"
final static String GOOGLE_ACCOUNT_NAME = "my-google-account"
final static String KUBERNETES_PROVIDER = "kubernetes"
final static String DOCKER_REGISTRY_PROVIDER = "dockerRegistry"
final static String GOOGLE_PROVIDER = "google"
final static String AZURE_ACCOUNT_NAME = "my-azure-account"
final static String AZURE_PROVIDER = "azure"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
static String DEPLOYMENT_NAME = "default"
static String KUBERNETES_ACCOUNT_NAME = "my-k8s-account"
static String DOCKER_REGISTRY_ACCOUNT_NAME = "my-docker-account"
static String GOOGLE_ACCOUNT_NAME = "my-google-account"
static String KUBERNETES_PROVIDER = "kubernetes"
static String DOCKER_REGISTRY_PROVIDER = "dockerRegistry"
static String GOOGLE_PROVIDER = "google"
static String AZURE_ACCOUNT_NAME = "my-azure-account"
static String AZURE_PROVIDER = "azure"
HalconfigParserMocker mocker = new HalconfigParserMocker()

def "tracking validator hits all accounts"() {
setup:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package com.netflix.spinnaker.halyard.config.services.v1
import spock.lang.Specification

class WebhookServiceSpec extends Specification {
final String DEPLOYMENT = "default"
final HalconfigParserMocker mocker = new HalconfigParserMocker()
final LookupService lookupService = new LookupService()
String DEPLOYMENT = "default"
HalconfigParserMocker mocker = new HalconfigParserMocker()
LookupService lookupService = new LookupService()

LookupService getMockLookupService(String config) {
def lookupService = new LookupService()
Expand Down
14 changes: 2 additions & 12 deletions halyard-proto/halyard-proto.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@ dependencies {
api 'com.google.api.grpc:grpc-google-common-protos:1.0.5'
implementation 'io.grpc:grpc-all:1.8.0'

// If we're targeting Java 8, protoc will generate old @Generated annotations.
// But developers likely won't have the cross-compiler plugin turned on, so
// those old annotations won't be available to javac (only the new Java 9
// versions will be). So we'll add those to the classpath.
//
// This can be deleted when we're properly targeting Java 11 (at which point
// protoc will generate code for the newer annotations.
if (JavaVersion.current().isJava9Compatible()
&& targetCompatibility == JavaVersion.VERSION_1_8
&& !Boolean.valueOf(project.findProperty('enableCrossCompilerPlugin'))) {
implementation 'javax.annotation:javax.annotation-api:1.3.2'
}
// requirement when targeting java 11
implementation 'javax.annotation:javax.annotation-api:1.3.2'
}

protobuf {
Expand Down

0 comments on commit 4b23103

Please sign in to comment.