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
1725import 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+
1938plugins {
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
2649allprojects {
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+ }
0 commit comments