Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the root project a composite build #97

Merged
merged 18 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
martinbonnin marked this conversation as resolved.
Show resolved Hide resolved
${CURDIR}/gradlew plugin:build
${CURDIR}/gradlew plugin:publishToMavenLocal
${CURDIR}/gradlew generateSwagger

martinbonnin marked this conversation as resolved.
Show resolved Hide resolved
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
martinbonnin marked this conversation as resolved.
Show resolved Hide resolved
${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")