summaryrefslogtreecommitdiff
path: root/opendc-model-odc
diff options
context:
space:
mode:
authorFabian Mastenbroek <fabianishere@outlook.com>2018-07-11 23:38:40 +0200
committerGitHub <noreply@github.com>2018-07-11 23:38:40 +0200
commit5fb2d1cb376d94540b6dff9ff769bbd56bcab153 (patch)
treea16c87718b83c3ba12e46496a266878848f29bb8 /opendc-model-odc
parentbc814ab5b5a4becf3dbc5f796a165955c0305d70 (diff)
parent8c7e208233c86614ac29157efba24e3a57d7f21c (diff)
chore: Update build toolchain (#23)
This pull requests updates the project as follows: 1. **Update Gradle version to 4.8** This allows us to make use of new features such as native JUnit 5 integration and the build cache. 2. **Update Gradle build configuration according to new changes** This change allows us to share configuration across modules and easily change the versions for shared dependencies. In addition, we now make use of the `java-library` plugin which allows for various optimizations. See https://docs.gradle.org/current/userguide/java_library_plugin.html 3. **Add support for Jacoco** We add support code coverage tracking via the latest version of Jacoco which has increasing support for Kotlin. Closes #22
Diffstat (limited to 'opendc-model-odc')
-rw-r--r--opendc-model-odc/core/build.gradle64
-rw-r--r--opendc-model-odc/jpa/build.gradle66
-rw-r--r--opendc-model-odc/setup/build.gradle53
3 files changed, 26 insertions, 157 deletions
diff --git a/opendc-model-odc/core/build.gradle b/opendc-model-odc/core/build.gradle
index e423da50..091dcbe4 100644
--- a/opendc-model-odc/core/build.gradle
+++ b/opendc-model-odc/core/build.gradle
@@ -23,67 +23,23 @@
*/
/* Build configuration */
-buildscript {
- ext.kotlin_version = '1.2.21'
- ext.dokka_version = '0.9.15'
-
- repositories {
- mavenCentral()
- jcenter()
- }
-
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
- classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.3'
- }
-}
-
-apply plugin: 'java'
-apply plugin: 'kotlin'
-apply plugin: 'org.jetbrains.dokka'
-apply plugin: 'org.junit.platform.gradle.plugin'
-
-compileKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-compileTestKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-kotlin {
- experimental {
- coroutines 'enable'
- }
-}
-
-dokka {
- outputFormat = 'html'
- outputDirectory = "$buildDir/javadoc"
-}
+apply from: '../../gradle/kotlin.gradle'
+apply plugin: 'java-library'
/* Project configuration */
-group 'com.atlarge.opendc'
-version '1.1'
-
repositories {
jcenter()
}
dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib"
- compile project(':opendc-core')
- compile project(':opendc-stdlib')
- compile "io.github.microutils:kotlin-logging:1.4.6"
+ api project(':opendc-core')
+ api project(':opendc-stdlib')
+ implementation "io.github.microutils:kotlin-logging:1.4.6"
- testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-RC3"
- testRuntime "org.junit.jupiter:junit-jupiter-engine:5.0.0-RC3"
- testCompile "org.junit.platform:junit-platform-launcher:1.0.0-RC3"
- testCompile "org.slf4j:slf4j-simple:1.7.25"
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version"
+ testImplementation "org.junit.platform:junit-platform-launcher:$junit_platform_version"
+ testRuntimeOnly "org.slf4j:slf4j-simple:1.7.25"
}
diff --git a/opendc-model-odc/jpa/build.gradle b/opendc-model-odc/jpa/build.gradle
index 191ca787..33b50d39 100644
--- a/opendc-model-odc/jpa/build.gradle
+++ b/opendc-model-odc/jpa/build.gradle
@@ -23,69 +23,25 @@
*/
/* Build configuration */
-buildscript {
- ext.kotlin_version = '1.2.21'
- ext.dokka_version = '0.9.15'
-
- repositories {
- mavenCentral()
- jcenter()
- }
-
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version"
- classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
- classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC3'
- }
-}
-
-apply plugin: 'java'
-apply plugin: 'kotlin'
+apply from: '../../gradle/kotlin.gradle'
+apply plugin: 'java-library'
apply plugin: 'kotlin-jpa'
-apply plugin: 'org.jetbrains.dokka'
-apply plugin: 'org.junit.platform.gradle.plugin'
-
-compileKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-compileTestKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-kotlin {
- experimental {
- coroutines 'enable'
- }
-}
-
-dokka {
- outputFormat = 'html'
- outputDirectory = "$buildDir/javadoc"
-}
/* Project configuration */
-group 'com.atlarge.opendc'
-version '1.1'
-
repositories {
jcenter()
}
dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib"
- compile project(':opendc-core')
- compile project(':opendc-stdlib')
- compile project(':opendc-model-odc:core')
- compile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final'
+ api project(':opendc-core')
+ api project(':opendc-stdlib')
+ api project(':opendc-model-odc:core')
+ api "javax.persistence:javax.persistence-api:2.2"
+ implementation "io.github.microutils:kotlin-logging:1.4.6"
- testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-RC3'
- testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.0-RC3'
- testCompile 'org.junit.platform:junit-platform-launcher:1.0.0-RC3'
+ testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version"
+ testImplementation "org.junit.platform:junit-platform-launcher:$junit_platform_version"
}
diff --git a/opendc-model-odc/setup/build.gradle b/opendc-model-odc/setup/build.gradle
index 1cca2a6e..c3976986 100644
--- a/opendc-model-odc/setup/build.gradle
+++ b/opendc-model-odc/setup/build.gradle
@@ -23,56 +23,12 @@
*/
/* Build configuration */
-buildscript {
- ext.kotlin_version = '1.2.21'
- ext.dokka_version = '0.9.15'
-
- repositories {
- mavenCentral()
- jcenter()
- }
-
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version"
- classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
- }
-}
-
-apply plugin: 'java'
+apply from: '../../gradle/kotlin.gradle'
apply plugin: 'application'
-apply plugin: 'kotlin'
-apply plugin: 'org.jetbrains.dokka'
mainClassName = "com.atlarge.opendc.model.odc.platform.JpaPlatformRunnerKt"
-compileKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-compileTestKotlin {
- kotlinOptions {
- jvmTarget = "1.8"
- }
-}
-
-kotlin {
- experimental {
- coroutines 'enable'
- }
-}
-
-dokka {
- outputFormat = 'html'
- outputDirectory = "$buildDir/javadoc"
-}
-
/* Project configuration */
-group 'com.atlarge.opendc'
-version '1.1'
-
repositories {
jcenter()
}
@@ -80,8 +36,9 @@ repositories {
dependencies {
compile project(':opendc-model-odc:jpa')
compile project(':opendc-kernel-omega')
+ compile "io.github.microutils:kotlin-logging:1.4.6"
- runtime 'org.slf4j:slf4j-simple:1.7.25'
- runtime 'org.hibernate:hibernate-core:5.2.5.Final'
- runtime 'mysql:mysql-connector-java:5.1.13'
+ runtimeOnly "org.slf4j:slf4j-simple:1.7.25"
+ runtimeOnly "org.hibernate:hibernate-core:5.2.5.Final"
+ runtimeOnly "mysql:mysql-connector-java:5.1.13"
}