Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Gradle plugin for bootstrapping projects built with Spine.
In order to apply the plugin to a Gradle project, in `build.gralde` add the following config:
```gradle
plugins {
id 'io.spine.tools.gradle.bootstrap' version '1.5.8'
id("io.spine.tools.gradle.bootstrap").version("1.5.8")
}
```

Expand Down Expand Up @@ -51,7 +51,7 @@ In order to use the same version for other Spine libraries, please use `sine.ver
```gradle
dependencies {
//...
testImplementation "io.spine:spine-testutil-server:${spine.version()}"
testImplementation("io.spine:spine-testutil-server:${spine.version()}")
}
```

Expand Down
125 changes: 0 additions & 125 deletions build.gradle

This file was deleted.

127 changes: 127 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/*
* Copyright 2020, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import io.spine.gradle.internal.DependencyResolution
import io.spine.gradle.internal.Deps
import io.spine.gradle.internal.PublishingRepos

plugins {
java
idea
jacoco
@Suppress("RemoveRedundantQualifierName") // Cannot use imports here.
id("net.ltgt.errorprone").version(io.spine.gradle.internal.Deps.versions.errorPronePlugin)
}

extra["credentialsPropertyFile"] = PublishingRepos.cloudRepo.credentials
extra["projectsToPublish"] = listOf("plugin")

apply(from = "$rootDir/version.gradle.kts")

val spineVersion: String by extra
val spineBaseVersion: String by extra

allprojects {
apply(from = "$rootDir/version.gradle.kts")
apply(from = "$rootDir/config/gradle/dependencies.gradle")

group = "io.spine.tools"
version = spineVersion
}

subprojects {
apply {
plugin("java")
plugin("idea")
plugin("net.ltgt.errorprone")
plugin("pmd")

from(Deps.scripts.slowTests(project))
from(Deps.scripts.testOutput(project))
from(Deps.scripts.javadocOptions(project))
from(Deps.scripts.pmd(project))
from(Deps.scripts.projectLicenseReport(project))
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

DependencyResolution.defaultRepositories(repositories)

dependencies {
errorprone(Deps.build.errorProneCore)
errorproneJavac(Deps.build.errorProneJavac)

Deps.build.errorProneAnnotations.forEach { implementation(it) }
implementation(Deps.build.checkerAnnotations)
implementation(Deps.build.guava)
implementation("io.spine:spine-base:$spineBaseVersion")

testImplementation(Deps.test.guavaTestlib)
Deps.test.junit5Api.forEach { testImplementation(it) }
testImplementation(Deps.test.junit5Runner)
Deps.test.truth.forEach { testImplementation(it) }
}

DependencyResolution.forceConfiguration(configurations)

tasks.withType(Test::class) {
useJUnitPlatform {
includeEngines("junit-jupiter")
}
}

tasks.register("sourceJar", Jar::class) {
from(sourceSets.main.get().allJava)
archiveClassifier.set("sources")
}

tasks.register("testOutputJar", Jar::class) {
from(sourceSets.test.get().output)
archiveClassifier.set("test")
}

tasks.register("javadocJar", Jar::class) {
from("$projectDir/build/docs/javadoc")
archiveClassifier.set("javadoc")
dependsOn(tasks.javadoc)
}

idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
}

apply {
from(Deps.scripts.publish(project))
from(Deps.scripts.jacoco(project))
from(Deps.scripts.repoLicenseReport(project))
from(Deps.scripts.generatePom(project))
}

rootProject.afterEvaluate {
val pluginProject = project(":plugin")
pluginProject.tasks["publish"].dependsOn(pluginProject.tasks["publishPlugins"])
}
34 changes: 34 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2020, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

plugins {
`kotlin-dsl`
}

repositories {
mavenLocal()
jcenter()
}

val jacksonVersion = "2.11.0"

dependencies {
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
}
35 changes: 35 additions & 0 deletions buildSrc/src/main/kotlin/bootstrap-plugin.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2020, TeamDev. All rights reserved.
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

plugins {
java
`java-gradle-plugin`
}

gradlePlugin {
plugins {
create("spineBootstrapPlugin") {
id = "io.spine.tools.gradle.bootstrap"
implementationClass = "io.spine.tools.gradle.bootstrap.BootstrapPlugin"
displayName = "Spine Bootstrap"
description = "Prepares a Gradle project for development on Spine."
}
}
}
Loading