Skip to content

Commit

Permalink
Merge pull request #97 from martinbonnin/add-composite-build
Browse files Browse the repository at this point in the history
Make the root project a composite build
  • Loading branch information
cortinico committed Feb 7, 2020
2 parents d689512 + 8fadb86 commit cc71ca0
Show file tree
Hide file tree
Showing 52 changed files with 31 additions and 22 deletions.
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@
install-hooks: .git/hooks/pre-commit
@true

regenerate-samples:
${CURDIR}/gradlew plugin:build
${CURDIR}/gradlew plugin:publishToMavenLocal
${CURDIR}/gradlew generateSwagger

run-hooks: venv
${CURDIR}/venv/bin/pre-commit run --all-files

test: run-hooks
${CURDIR}/gradlew plugin:build
${CURDIR}/gradlew plugin:publishToMavenLocal
${CURDIR}/gradlew --project-dir gradle-plugin build check
${CURDIR}/gradlew generateSwagger
${CURDIR}/gradlew assembleDebug
${CURDIR}/gradlew check
# The check task requires a lot of MetaSpace
${CURDIR}/gradlew assembleDebug check -Dorg.gradle.jvmargs="-Xmx4g -XX:MaxMetaspaceSize=2g"

venv:
virtualenv venv
Expand Down
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
group = PublishingVersions.PLUGIN_GROUP
version = PublishingVersions.PLUGIN_VERSION

subprojects {
repositories {
google()
Expand Down
10 changes: 10 additions & 0 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
group = PublishingVersions.PLUGIN_GROUP
version = PublishingVersions.PLUGIN_VERSION

subprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ configure<PublishingExtension> {
detekt {
toolVersion = "1.4.0"
input = files("src/")
config = rootProject.files("./config/detekt/detekt.yml")
config = rootProject.files("../config/detekt/detekt.yml")
}

tasks.jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MainTest {
private fun runGenerator(platform: String) {
val junitTestsSpecsPath = File(
// Repo root
File(".").absoluteFile.parentFile.parentFile.absolutePath,
File(".").absoluteFile.parentFile.parentFile.parentFile.absolutePath,
"samples${File.separator}junit-tests${File.separator}junit_tests_specs.json"
).path

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply(plugin = "com.yelp.codegen.plugin")
configure<GenerateTaskConfiguration> {
platform = "kotlin"
packageName = "com.yelp.codegen.samples"
// this file is in rootDir/plugin/build/testProject/
inputFile = file("../../../samples/junit-tests/junit_tests_specs.json")
// we are in rootDir/plugin-root/plugin/build/testProject/
inputFile = file("../../../../samples/junit-tests/junit_tests_specs.json")
outputDir = file("./build/generatedSources")
}
9 changes: 9 additions & 0 deletions gradle-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
jcenter()
}
}

include(":plugin")
1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

1 change: 0 additions & 1 deletion samples/groovy-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
Expand Down
1 change: 0 additions & 1 deletion samples/junit-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
Expand Down
1 change: 0 additions & 1 deletion samples/kotlin-coroutines/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
repositories {
mavenLocal()
gradlePluginPortal()
google()
mavenCentral()
Expand Down
7 changes: 5 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rootProject.name = "swagger-gradle-codegen"

pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
mavenCentral()
jcenter()
Expand All @@ -15,9 +16,11 @@ pluginManagement {
}
}

include(":plugin",
include(
":samples:junit-tests",
":samples:kotlin-android",
":samples:kotlin-android-moshi-codegen",
":samples:kotlin-coroutines",
":samples:groovy-android")

includeBuild("gradle-plugin")

0 comments on commit cc71ca0

Please sign in to comment.