Skip to content

Commit 0b683d9

Browse files
yuinacornoveler17
authored andcommitted
#5 Bootstrap multi-project-support by build recipe (#7)
1 parent 291a578 commit 0b683d9

File tree

5 files changed

+101
-49
lines changed

5 files changed

+101
-49
lines changed

build-recipe-plugin/build.gradle.kts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
* under the License.
1515
*/
1616

17-
plugins {
18-
`kotlin-dsl`
19-
`java-gradle-plugin`
20-
id("com.gradle.plugin-publish")
21-
}
22-
2317
gradlePlugin {
2418
plugins {
2519
register("buildRecipePlugin") {
@@ -30,29 +24,12 @@ gradlePlugin {
3024
}
3125

3226
dependencies {
33-
testImplementation(kotlin("test-junit5"))
34-
35-
testImplementation(gradleTestKit())
36-
testImplementation(gradleApi())
37-
testImplementation(gradleKotlinDsl())
38-
testImplementation(kotlin("stdlib"))
39-
4027
testImplementation("io.mockk:mockk:1.8.13")
41-
testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.1")
4228
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.19")
43-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.1")
44-
}
45-
46-
tasks {
47-
test {
48-
useJUnitPlatform()
49-
}
5029
}
5130
}
5231

5332
pluginBundle {
54-
website = "https://github.com/line/multi-project-support"
55-
vcsUrl = "https://github.com/line/multi-project-support"
5633
description = "Simple DSL plugin for managing large scale multi-application multi-project in mono-repo"
5734

5835
(plugins) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright 2019 LINE Corporation
3+
#
4+
# LINE Corporation licenses this file to you under the Apache License,
5+
# version 2.0 (the "License"); you may not use this file except in compliance
6+
# with the License. You may obtain a copy of the License at:
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
#
16+
17+
type=kotlin-gradle-plugin
18+
label=junit5-platform

build.gradle.kts

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,46 @@
1414
* under the License.
1515
*/
1616

17+
import com.gradle.publish.PluginBundleExtension
18+
import com.linecorp.support.project.multi.recipe.configure
19+
import com.linecorp.support.project.multi.recipe.configureByType
20+
import com.linecorp.support.project.multi.recipe.configureByTypePrefix
21+
import com.linecorp.support.project.multi.recipe.configureByTypeSuffix
22+
import com.linecorp.support.project.multi.recipe.matcher.ProjectMatchers.Companion.byLabel
23+
import com.linecorp.support.project.multi.recipe.matcher.ProjectMatchers.Companion.byTypeSuffix
24+
import com.linecorp.support.project.multi.recipe.matcher.and
1725
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1826

27+
buildscript {
28+
repositories {
29+
maven {
30+
url = uri("https://plugins.gradle.org/m2/")
31+
}
32+
}
33+
dependencies {
34+
classpath("org.gradle.kotlin:plugins:1.3.1")
35+
}
36+
}
37+
1938
plugins {
20-
java
39+
idea
40+
eclipse
41+
`visual-studio`
42+
xcode
2143
kotlin("jvm") version embeddedKotlinVersion
2244
id("com.gradle.plugin-publish").version("0.10.1").apply(false)
2345
id("org.jmailen.kotlinter") version "2.1.2"
46+
id("com.linecorp.build-recipe-plugin") version "1.0.0"
2447
}
2548

2649
allprojects {
27-
apply(plugin = "kotlin")
28-
2950
repositories {
3051
mavenCentral()
3152
}
53+
}
54+
55+
configureByTypePrefix("kotlin") {
56+
apply(plugin = "kotlin")
3257

3358
configure<JavaPluginConvention> {
3459
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -38,3 +63,40 @@ allprojects {
3863
kotlinOptions.jvmTarget = "1.8"
3964
}
4065
}
66+
67+
configureByType("kotlin-gradle-plugin") {
68+
apply(plugin = "org.gradle.kotlin.kotlin-dsl")
69+
apply(plugin = "org.gradle.java-gradle-plugin")
70+
apply(plugin = "com.gradle.plugin-publish")
71+
72+
configure<GradlePluginDevelopmentExtension> {
73+
dependencies {
74+
testImplementation(gradleTestKit())
75+
testImplementation(gradleApi())
76+
testImplementation(gradleKotlinDsl())
77+
testImplementation(kotlin("stdlib"))
78+
}
79+
}
80+
}
81+
82+
configureByTypeSuffix("gradle-plugin") {
83+
configure<PluginBundleExtension> {
84+
website = "https://github.com/line/multi-project-support"
85+
vcsUrl = "https://github.com/line/multi-project-support"
86+
}
87+
}
88+
89+
configure(byTypeSuffix("gradle-plugin") and byLabel("junit5-platform")) {
90+
dependencies {
91+
testImplementation(kotlin("test-junit5"))
92+
testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.1")
93+
94+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.1")
95+
}
96+
97+
tasks {
98+
test {
99+
useJUnitPlatform()
100+
}
101+
}
102+
}

recursive-git-log-plugin/build.gradle.kts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
* under the License.
1515
*/
1616

17-
plugins {
18-
`kotlin-dsl`
19-
`java-gradle-plugin`
20-
id("com.gradle.plugin-publish")
21-
}
22-
2317
gradlePlugin {
2418
plugins {
2519
register("recursiveGitLogPlugin") {
@@ -30,29 +24,12 @@ gradlePlugin {
3024
}
3125

3226
dependencies {
33-
testImplementation(kotlin("test-junit5"))
34-
35-
testImplementation(gradleTestKit())
36-
testImplementation(gradleApi())
37-
testImplementation(gradleKotlinDsl())
38-
testImplementation(kotlin("stdlib"))
39-
4027
testImplementation("io.mockk:mockk:1.8.13")
41-
testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.1")
4228
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.19")
43-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.1")
44-
}
45-
46-
tasks {
47-
test {
48-
useJUnitPlatform()
49-
}
5029
}
5130
}
5231

5332
pluginBundle {
54-
website = "https://github.com/line/multi-project-support"
55-
vcsUrl = "https://github.com/line/multi-project-support"
5633
description = "A plugin for extract affected change log via git history and Gradle project dependency"
5734

5835
(plugins) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright 2019 LINE Corporation
3+
#
4+
# LINE Corporation licenses this file to you under the Apache License,
5+
# version 2.0 (the "License"); you may not use this file except in compliance
6+
# with the License. You may obtain a copy of the License at:
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
# License for the specific language governing permissions and limitations
14+
# under the License.
15+
#
16+
17+
type=kotlin-gradle-plugin
18+
label=junit5-platform

0 commit comments

Comments
 (0)