From 026dc1e52c78983ffa3dbcda21aab1453ab21de2 Mon Sep 17 00:00:00 2001 From: Tomasz Linkowski Date: Fri, 14 Jun 2019 09:09:23 +0200 Subject: [PATCH] #3: added proper build configuration + an empty plugin class --- subprojects/plugin/gradle.properties | 22 ++++++++++++ subprojects/plugin/plugin.gradle.kts | 36 +++++++++++++++++++ .../pl/tlinkowski/TLinkowskiSuperpomPlugin.kt | 36 +++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 subprojects/plugin/gradle.properties create mode 100644 subprojects/plugin/src/main/kotlin/pl/tlinkowski/TLinkowskiSuperpomPlugin.kt diff --git a/subprojects/plugin/gradle.properties b/subprojects/plugin/gradle.properties new file mode 100644 index 0000000..1b439d4 --- /dev/null +++ b/subprojects/plugin/gradle.properties @@ -0,0 +1,22 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2019 Tomasz Linkowski. +# +# 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. +# +version=0.1 +# DEPENDENCIES +kordampVersion=0.21.0 +spockVersion=1.3-groovy-2.5 +groovyVersion=2.5.6 diff --git a/subprojects/plugin/plugin.gradle.kts b/subprojects/plugin/plugin.gradle.kts index cf8eec2..befeeed 100644 --- a/subprojects/plugin/plugin.gradle.kts +++ b/subprojects/plugin/plugin.gradle.kts @@ -1,12 +1,48 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { + //region MAIN kotlin("jvm") version "1.3.30" + `java-gradle-plugin` + `kotlin-dsl` + //endregion + + //region TEST + groovy + //endregion } +//region gradle.properties +val kordampVersion: String by project +val spockVersion: String by project +val groovyVersion: String by project +//endregion + tasks.withType { kotlinOptions.jvmTarget = "1.8" } + +repositories { + gradlePluginPortal() // for other Gradle plugins +} + dependencies { + //region MAIN implementation(kotlin("stdlib-jdk8")) + implementation(group = "org.kordamp.gradle", name = "base-gradle-plugin", version = kordampVersion) + //endregion + + //region TEST + testImplementation(group = "org.spockframework", name = "spock-core", version = spockVersion) + testImplementation(group = "org.codehaus.groovy", name = "groovy-all", version = groovyVersion) + //endregion +} + +gradlePlugin { + plugins { + create("TLinkowskiSuperpom") { + id = "pl.tlinkowski.tlinkowski-superpom" + implementationClass = "pl.tlinkowski.TLinkowskiSuperpomPlugin" + } + } } diff --git a/subprojects/plugin/src/main/kotlin/pl/tlinkowski/TLinkowskiSuperpomPlugin.kt b/subprojects/plugin/src/main/kotlin/pl/tlinkowski/TLinkowskiSuperpomPlugin.kt new file mode 100644 index 0000000..23ce51c --- /dev/null +++ b/subprojects/plugin/src/main/kotlin/pl/tlinkowski/TLinkowskiSuperpomPlugin.kt @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright 2019 Tomasz Linkowski. + * + * 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 pl.tlinkowski + +import org.gradle.api.Plugin +import org.gradle.api.Project + +/** + * Applies the concept of a Gradle SuperPOM for all projects of Tomasz Linkowski. + * + * See: [http://andresalmiray.com/the-gradle-superpom/] + * + * @author Tomasz Linkowski + */ +class TLinkowskiSuperpomPlugin : Plugin { + + override fun apply(project: Project) { + + } +}