Skip to content

Commit fd5b045

Browse files
authored
Updates build files to kotlin dsl and updates license headers (#185)
- Converts to kotlin dsl for gradle builds - Updates license header. - Manually adds license headers to buildSrc module. The buildSrc module is not part of the project; it provides metadata and utility functionality for the project. - Upgrades Detekt and test-logger dependencies and cleans up detekt config.
1 parent 1914749 commit fd5b045

File tree

114 files changed

+1005
-1443
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1005
-1443
lines changed

build.gradle

Lines changed: 0 additions & 112 deletions
This file was deleted.

build.gradle.kts

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/*
2+
Copyright (c) 2018 Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/
7+
// Build file
8+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
9+
10+
description = "SAML Conformance Test Kit"
11+
12+
buildscript {
13+
repositories {
14+
jcenter()
15+
mavenCentral()
16+
}
17+
18+
dependencies {
19+
classpath(Libs.kotlinGradlePlugin)
20+
classpath(Libs.gradleDockerPlugin)
21+
}
22+
}
23+
24+
plugins {
25+
id("org.jetbrains.kotlin.jvm").version(Versions.kotlin)
26+
id("io.gitlab.arturbosch.detekt").version(Versions.detekt)
27+
id("com.diffplug.gradle.spotless").version(Versions.spotless)
28+
id("net.ltgt.errorprone").version(Versions.errorprone)
29+
id("com.adarshr.test-logger").version(Versions.testLogger)
30+
}
31+
32+
allprojects {
33+
group = "org.codice.samlconf"
34+
version = Versions.project
35+
36+
repositories {
37+
mavenLocal()
38+
mavenCentral()
39+
maven { url = uri("http://artifacts.codice.org/content/repositories/thirdparty/") }
40+
}
41+
42+
apply(plugin = "com.diffplug.gradle.spotless")
43+
44+
spotless {
45+
val kotlinLicenseFile = "codice.license.kt"
46+
java {
47+
licenseHeaderFile(rootProject.file(kotlinLicenseFile))
48+
trimTrailingWhitespace()
49+
googleJavaFormat()
50+
}
51+
kotlin {
52+
ktlint()
53+
licenseHeaderFile(rootProject.file(kotlinLicenseFile),
54+
"(package|@file|// Default package)")
55+
trimTrailingWhitespace()
56+
endWithNewline()
57+
}
58+
kotlinGradle {
59+
ktlint()
60+
licenseHeaderFile(rootProject.file(kotlinLicenseFile), "// Build file")
61+
trimTrailingWhitespace()
62+
endWithNewline()
63+
}
64+
}
65+
}
66+
67+
subprojects {
68+
apply(plugin = "java")
69+
apply(plugin = "maven")
70+
apply(plugin = "kotlin-kapt")
71+
apply(plugin = "kotlin")
72+
apply(plugin = "com.bmuschko.docker-remote-api")
73+
apply(plugin = "net.ltgt.errorprone")
74+
apply(plugin = "com.adarshr.test-logger")
75+
76+
val sourceCompatibility = Versions.javaTarget
77+
val targetCompatibility = Versions.javaTarget
78+
79+
dependencies {
80+
compile("org.jetbrains.kotlin:kotlin-reflect")
81+
compile(Libs.kotlinStdlibJdk8)
82+
compile(Libs.kotlinTest)
83+
compile(Libs.restAssured)
84+
compile(Libs.slf4j)
85+
compile(Libs.staticLog)
86+
compile(Libs.guava)
87+
compile(Libs.kotlinTestRunner)
88+
compile(Libs.junitPlatformSuite)
89+
compile(Libs.junitPlatformRunner)
90+
testCompile(Libs.mockk)
91+
}
92+
93+
tasks.withType<Test> {
94+
useJUnitPlatform()
95+
}
96+
}
97+
98+
tasks {
99+
"build" {
100+
dependsOn("detektCheck")
101+
}
102+
}
103+
104+
detekt {
105+
version = Versions.detekt
106+
107+
defaultProfile(Action {
108+
input = rootProject.projectDir.absolutePath
109+
config = "$projectDir/detekt.yml"
110+
filters = ".*/resources/.*,.*/tmp/.*"
111+
})
112+
}
113+
114+
val compileKotlin: KotlinCompile by tasks
115+
compileKotlin.kotlinOptions {
116+
jvmTarget = Versions.javaTarget
117+
}
118+
val compileTestKotlin: KotlinCompile by tasks
119+
compileTestKotlin.kotlinOptions {
120+
jvmTarget = Versions.javaTarget
121+
}
122+
val compileJava: JavaCompile by tasks
123+
compileJava.options.encoding = "UTF-8"

buildSrc/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
Copyright (c) 2018 Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/
7+
// Build file
8+
plugins {
9+
`kotlin-dsl`
10+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright (c) 2018 Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/
7+
// Default package
8+
@file:Suppress("MaxLineLength")
9+
object Versions {
10+
const val project = "1.0-SNAPSHOT"
11+
12+
const val javaTarget = "1.8"
13+
14+
const val kotlin = "1.2.51"
15+
const val gradleDocker = "3.2.4"
16+
const val kotlinTest = "3.1.5"
17+
const val restAssured = "3.1.0"
18+
const val slf4j = "1.7.1"
19+
const val guava = "25.1-jre"
20+
const val spotless = "3.10.0"
21+
const val errorprone = "0.0.16"
22+
const val testLogger = "1.4.0"
23+
const val detekt = "1.0.0.RC8"
24+
const val staticLog = "2.2.0"
25+
const val mockk = "1.8"
26+
const val junitJupiter = "5.1.0"
27+
const val junitPlatform = "1.1.1"
28+
const val wss4j = "2.2.2"
29+
const val cxf = "3.2.4"
30+
const val kaptMetainf = "1.1"
31+
const val gson = "2.8.0"
32+
const val kopperTyped = "0.0.3"
33+
const val jansi = "1.17.1"
34+
const val googleHttpClient = "1.22.0"
35+
const val keyczar = "0.66"
36+
const val jtidy = "r938"
37+
}
38+
39+
object Libs {
40+
const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}"
41+
const val kotlinStdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}"
42+
const val kotlinTest = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}"
43+
44+
const val gradleDockerPlugin = "com.bmuschko:gradle-docker-plugin:${Versions.gradleDocker}"
45+
const val restAssured = "io.rest-assured:rest-assured:${Versions.restAssured}"
46+
const val slf4j = "org.slf4j:slf4j-api:${Versions.slf4j}"
47+
const val staticLog = "io.github.jupf.staticlog:staticlog:${Versions.staticLog}"
48+
const val guava = "com.google.guava:guava:${Versions.guava}"
49+
const val kotlinTestRunner = "io.kotlintest:kotlintest-runner-junit5:${Versions.kotlinTest}"
50+
51+
const val junitPlatformSuite = "org.junit.platform:junit-platform-suite-api:${Versions.junitPlatform}"
52+
const val junitPlatformRunner = "org.junit.platform:junit-platform-runner:${Versions.junitPlatform}"
53+
const val junitJupiter = "org.junit.jupiter:junit-jupiter-api:${Versions.junitJupiter}"
54+
const val junitJupiterEngine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junitJupiter}"
55+
const val junitJupiterParams = "org.junit.jupiter:junit-jupiter-params:${Versions.junitJupiter}"
56+
const val mockk = "io.mockk:mockk:${Versions.mockk}"
57+
58+
const val cxfSsoSaml = "org.apache.cxf:cxf-rt-rs-security-sso-saml:${Versions.cxf}"
59+
const val wss4jCommon = "org.apache.wss4j:wss4j-ws-security-common:${Versions.wss4j}"
60+
61+
const val kaptMetainfService = "org.kohsuke.metainf-services:metainf-services:${Versions.kaptMetainf}"
62+
const val gson = "com.google.code.gson:gson:${Versions.gson}"
63+
64+
const val kopperTyped = "us.jimschubert:kopper-typed:${Versions.kopperTyped}"
65+
const val jansi = "org.fusesource.jansi:jansi:${Versions.jansi}"
66+
const val googleHttpClient = "com.google.http-client:google-http-client:${Versions.googleHttpClient}"
67+
const val keyczar = "org.keyczar:keyczar:${Versions.keyczar}"
68+
const val jtidy = "net.sf.jtidy:jtidy:${Versions.jtidy}"
69+
}

codice.license.kt

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
/**
2-
* Copyright (c) Codice Foundation
3-
*
4-
* <p>This is free software: you can redistribute it and/or modify it under the terms of the GNU
5-
* Lesser General Public License as published by the Free Software Foundation, either version 3 of
6-
* the License, or any later version.
7-
*
8-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10-
* GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public
11-
* License is distributed along with this program and can be found at
12-
* <http://www.gnu.org/licenses/lgpl.html>.
13-
*/
1+
/*
2+
Copyright (c) $YEAR Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/

ctk/common/build.gradle

Lines changed: 0 additions & 13 deletions
This file was deleted.

ctk/common/build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
Copyright (c) 2018 Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/
7+
// Build file
8+
group = "org.codice.samlconf.test"
9+
description = "Common Functions for IdP Tests."
10+
11+
dependencies {
12+
compile(project(":library"))
13+
compile(project(":external:samlconf-plugins-api"))
14+
15+
compile(Libs.wss4jCommon)
16+
testCompile(Libs.kotlinTestRunner)
17+
testImplementation(Libs.junitJupiter)
18+
testImplementation(Libs.junitJupiterParams)
19+
testRuntimeOnly(Libs.junitJupiterEngine)
20+
}

ctk/common/src/main/java/org/codice/compliance/utils/sign/SimpleSign.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
/**
2-
* Copyright (c) Codice Foundation
3-
*
4-
* <p>This is free software: you can redistribute it and/or modify it under the terms of the GNU
5-
* Lesser General Public License as published by the Free Software Foundation, either version 3 of
6-
* the License, or any later version.
7-
*
8-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10-
* GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public
11-
* License is distributed along with this program and can be found at
12-
* <http://www.gnu.org/licenses/lgpl.html>.
13-
*/
1+
/*
2+
Copyright (c) 2018 Codice Foundation
3+
4+
Released under the GNU Lesser General Public License; see
5+
http://www.gnu.org/licenses/lgpl.html
6+
*/
147
package org.codice.compliance.utils.sign;
158

169
import static org.codice.compliance.utils.TestCommon.getCurrentSPHostname;

0 commit comments

Comments
 (0)