Skip to content

Commit

Permalink
chore(build): remove kotlin from project (#848)
Browse files Browse the repository at this point in the history
Removes the (out of date) kotlin configuration from the project and
converts the single kotlin class to java
  • Loading branch information
cfieber committed May 21, 2021
1 parent 815ed9c commit 0e5406e
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 101 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

plugins {
id "io.spinnaker.project" version "$spinnakerGradleVersion" apply false
id "nebula.kotlin" version "$kotlinVersion" apply false
id 'idea'
}

Expand All @@ -31,7 +30,6 @@ subprojects { project ->
if (name != "kayenta-bom") {
apply plugin: "java-library"
apply plugin: "groovy"
apply plugin: "nebula.kotlin"

def localVersions = [orcaVersion].find { it.endsWith('-SNAPSHOT') }
if (localVersions) {
Expand Down Expand Up @@ -115,6 +113,7 @@ subprojects { project ->
testRuntimeOnly "org.objenesis:objenesis"
}
}

}

defaultTasks ":kayenta-web:run"
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
kotlinVersion=1.3.70
orcaVersion=8.18.0
org.gradle.parallel=true
spinnakerGradleVersion=8.11.0
Expand Down
32 changes: 0 additions & 32 deletions gradle/kotlin.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions kayenta-core/kayenta-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ dependencies {
api "net.lariverosc:jesque-spring:1.0.1"
api "net.greghaines:jesque:1.3.1"

api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
api "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"

api "org.apache.commons:commons-text:1.8"
api "org.springframework.boot:spring-boot-starter-actuator"
api "org.springframework.boot:spring-boot-starter-json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2019 Netflix, inc.
*
* 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.netflix.kayenta.events.listeners;

import com.netflix.kayenta.events.CanaryExecutionCompletedEvent;
import com.netflix.kayenta.security.AccountCredentials;
import com.netflix.kayenta.security.AccountCredentialsRepository;
import com.netflix.kayenta.storage.ObjectType;
import com.netflix.kayenta.storage.StorageServiceRepository;
import java.util.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@ConditionalOnProperty(
name = "kayenta.default-archivers.enabled",
havingValue = "true",
matchIfMissing = true)
@Component
public class ExecutionArchivalListener {
private static final Logger log = LoggerFactory.getLogger(ExecutionArchivalListener.class);

private final AccountCredentialsRepository accountCredentialsRepository;
private final StorageServiceRepository storageServiceRepository;

public ExecutionArchivalListener(
AccountCredentialsRepository accountCredentialsRepository,
StorageServiceRepository storageServiceRepository) {
this.accountCredentialsRepository = Objects.requireNonNull(accountCredentialsRepository);
this.storageServiceRepository = Objects.requireNonNull(storageServiceRepository);
log.info("Loaded ExecutionArchivalListener");
}

@EventListener
public void onApplicationEvent(CanaryExecutionCompletedEvent event) {
var response = event.getCanaryExecutionStatusResponse();
var storageAccountName = response.getStorageAccountName();
if (storageAccountName != null) {
var resolvedStorageAccountName =
accountCredentialsRepository
.getRequiredOneBy(storageAccountName, AccountCredentials.Type.OBJECT_STORE)
.getName();

var storageService = storageServiceRepository.getRequiredOne(resolvedStorageAccountName);

storageService.storeObject(
resolvedStorageAccountName,
ObjectType.CANARY_RESULT_ARCHIVE,
response.getPipelineId(),
response);
}
}
}

This file was deleted.

2 changes: 0 additions & 2 deletions kayenta-orca/kayenta-orca.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
apply from: "$rootDir/gradle/kotlin.gradle"

dependencies {
api "io.spinnaker.orca:keiko-spring"
api "io.spinnaker.orca:orca-queue"
Expand Down

0 comments on commit 0e5406e

Please sign in to comment.