Skip to content

Commit 3ed45db

Browse files
author
Kosh
committed
optimize lib-version plugin
1 parent 5240053 commit 3ed45db

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

build.gradle.kts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ buildscript {
1616
plugins {
1717
id(AppPlugins.DOKKA) version DependenciesVersion.DOKKA_VERSION
1818
id(AppPlugins.GITHUB_RELEASE) version DependenciesVersion.GITHUB_RELEASE_VERSION
19-
}
20-
21-
apply {
22-
plugin<com.github.k0shk0sh.plugins.LibVersionPlugin>()
19+
`lib-version`
2320
}
2421

2522
subprojects {
@@ -75,13 +72,4 @@ fun Project.configureDokka() {
7572
outputDirectory.set(file(DokkaConfig.OUTPUT_DIR))
7673
}
7774
}
78-
}
79-
80-
tasks.create("minorRelease") {
81-
dependsOn("nextMinor")
82-
project.afterEvaluate {
83-
dependsOn("publishToMavenLocal")
84-
}
85-
// .dependsOn("closeAndReleaseRepository")
86-
// .dependsOn("githubRelease")
8775
}

buildSrc/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ plugins {
44
`kotlin-dsl`
55
}
66

7+
gradlePlugin {
8+
plugins {
9+
register("libVersion-plugin") {
10+
id = "lib-version"
11+
implementationClass = "com.github.k0shk0sh.plugins.LibVersionPlugin"
12+
}
13+
}
14+
}
15+
716
repositories {
817
google()
918
mavenCentral()

buildSrc/src/main/kotlin/LibVersion.kt renamed to buildSrc/src/main/kotlin/com/github/k0shk0sh/plugins/LibVersion.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.github.k0shk0sh.plugins
2+
13
import groovy.json.JsonOutput
24
import groovy.json.JsonSlurper
35
import java.io.File

buildSrc/src/main/kotlin/com/github/k0shk0sh/plugins/LibVersionPlugin.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
package com.github.k0shk0sh.plugins
22

33
import org.gradle.api.*
4-
import LibVersion
5-
import LibVersionProvider
6-
import increaseMajor
7-
import increaseMinor
8-
import increasePatch
9-
import getLibVersion
104

115
class LibVersionPlugin : Plugin<Project> {
126
override fun apply(target: Project) {

0 commit comments

Comments
 (0)