-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from 422404/feature/convention-plugin
Use a convention plugin to avoid redundant project configurations
- Loading branch information
Showing
8 changed files
with
83 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,10 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
id 'com.adarshr.test-logger' | ||
id 'jacoco' | ||
id 'actorlang.kotlin-conventions' | ||
} | ||
|
||
group = 'org.actorlang' | ||
version = '1.1.1-SNAPSHOT' | ||
archivesBaseName = 'org.actorlang.actorsystem-impl' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.required = false | ||
csv.required = false | ||
html.outputLocation = file("${buildDir}/reports/jacoco/html") | ||
} | ||
} | ||
version = parent.version | ||
archivesBaseName = "${parent.group}.actorsystem-impl" | ||
|
||
dependencies { | ||
implementation project(":actorsystem-servicecontract") | ||
|
||
// Tests | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
implementation "io.github.microutils:kotlin-logging-jvm:3.0.4" | ||
runtimeOnly "org.slf4j:slf4j-simple:2.0.3" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,6 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
id 'com.adarshr.test-logger' | ||
id 'jacoco' | ||
id 'actorlang.kotlin-conventions' | ||
} | ||
|
||
group = 'org.actorlang' | ||
version = '1.1.1-SNAPSHOT' | ||
archivesBaseName = 'org.actorlang.actorsystem-servicecontract' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.required = false | ||
csv.required = false | ||
html.outputLocation = file("${buildDir}/reports/jacoco/html") | ||
} | ||
} | ||
|
||
dependencies { | ||
// Tests | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
version = parent.version | ||
archivesBaseName = "${parent.group}.actorsystem-servicecontract" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,20 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' version '1.7.20' | ||
id 'application' | ||
id 'org.jlleitschuh.gradle.ktlint' version '10.0.0' | ||
id 'com.adarshr.test-logger' version '3.0.0' | ||
id 'jacoco' | ||
id 'actorlang.kotlin-conventions' | ||
} | ||
|
||
group = 'org.actorlang' | ||
version = '1.1.1-SNAPSHOT' | ||
archivesBaseName = 'org.actorlang.cli' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
archivesBaseName = "${group}.cli" | ||
|
||
application { | ||
mainClass.set('org.actorlang.cli.MainKt') | ||
applicationName = 'actorlang' | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.required = false | ||
csv.required = false | ||
html.outputLocation = file("${buildDir}/reports/jacoco/html") | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(":actorsystem-servicecontract") | ||
implementation project(":actorsystem-impl") | ||
implementation project(":parser") | ||
implementation project(":interpreter") | ||
implementation project(":actorsystem-impl") | ||
implementation project(":actorsystem-servicecontract") | ||
|
||
// Tests | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
|
||
implementation "io.github.microutils:kotlin-logging-jvm:3.0.4" | ||
runtimeOnly "org.slf4j:slf4j-simple:2.0.3" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
id 'groovy-gradle-plugin' | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.20' | ||
implementation 'org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:10.0.0' | ||
implementation 'com.adarshr.test-logger:com.adarshr.test-logger.gradle.plugin:3.0.0' | ||
} |
41 changes: 41 additions & 0 deletions
41
buildSrc/src/main/groovy/actorlang.kotlin-conventions.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// https://discuss.gradle.org/t/applying-a-plugin-version-inside-a-convention-plugin/42160/2 | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
id 'com.adarshr.test-logger' | ||
id 'jacoco' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
dependencies { | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
|
||
implementation "io.github.microutils:kotlin-logging-jvm:3.0.4" | ||
runtimeOnly "org.slf4j:slf4j-simple:2.0.3" | ||
} | ||
|
||
tasks.named('test', Test) { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.named('compileKotlin') { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
|
||
tasks.named('compileTestKotlin') { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,12 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
id 'com.adarshr.test-logger' | ||
id 'jacoco' | ||
id 'actorlang.kotlin-conventions' | ||
} | ||
|
||
group = 'org.actorlang' | ||
version = '1.1.1-SNAPSHOT' | ||
archivesBaseName = 'org.actorlang.interpreter' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.required = false | ||
csv.required = false | ||
html.outputLocation = file("${buildDir}/reports/jacoco/html") | ||
} | ||
} | ||
version = parent.version | ||
archivesBaseName = "${parent.group}.interpreter" | ||
|
||
dependencies { | ||
implementation project(":actorsystem-servicecontract") | ||
implementation project(":actorsystem-impl") | ||
implementation project(":parser") | ||
|
||
// Tests | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
|
||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
implementation "io.github.microutils:kotlin-logging-jvm:3.0.4" | ||
runtimeOnly "org.slf4j:slf4j-simple:2.0.3" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
compileKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,32 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'antlr' | ||
id 'org.jlleitschuh.gradle.ktlint' | ||
id 'com.adarshr.test-logger' | ||
id 'jacoco' | ||
id 'actorlang.kotlin-conventions' | ||
} | ||
|
||
group = 'org.actorlang' | ||
version = '1.1.1-SNAPSHOT' | ||
archivesBaseName = 'org.actorlang.parser' | ||
version = parent.version | ||
archivesBaseName = "${parent.group}.parser" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
jacoco { | ||
toolVersion = '0.8.8' | ||
dependencies { | ||
antlr 'org.antlr:antlr4:4.9' | ||
} | ||
|
||
generateGrammarSource { | ||
tasks.named('generateGrammarSource', AntlrTask) { | ||
arguments += ["-visitor", "-long-messages"] | ||
outputDirectory = file("src/main/java/") | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.required = false | ||
csv.required = false | ||
html.outputLocation = file("${buildDir}/reports/jacoco/html") | ||
} | ||
} | ||
|
||
dependencies { | ||
antlr 'org.antlr:antlr4:4.9' | ||
|
||
// Tests | ||
testImplementation "org.mockito:mockito-core:3.+" | ||
testImplementation 'org.mockito:mockito-inline:3.11.0' | ||
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
tasks.named('compileKotlin') { | ||
dependsOn tasks.named('generateGrammarSource') | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
dependsOn generateGrammarSource | ||
tasks.named('compileTestKotlin') { | ||
dependsOn tasks.named('generateTestGrammarSource') | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions.jvmTarget = '1.8' | ||
tasks.named('runKtlintCheckOverMainSourceSet') { | ||
dependsOn tasks.named('generateGrammarSource') | ||
} | ||
|
||
runKtlintCheckOverMainSourceSet { | ||
dependsOn generateGrammarSource | ||
tasks.named('runKtlintCheckOverTestSourceSet') { | ||
dependsOn tasks.named('generateTestGrammarSource') | ||
} |