Skip to content

Commit

Permalink
Move configuration to a convention plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Chelombitko committed Aug 3, 2024
1 parent e979c88 commit 7c19e17
Show file tree
Hide file tree
Showing 18 changed files with 333 additions and 317 deletions.
13 changes: 5 additions & 8 deletions .buildsystem/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#!/usr/bin/env bash
cd `dirname $0`/..

TARGETS=""
for i in ":core" ":vendor:vendor-android:base" ":vendor:vendor-android:ddmlib" ":marathon-gradle-plugin" ":report:execution-timeline" ":report:html-report"; do
TARGETS="$TARGETS $i:publishDefaultPublicationToMavenLocal"
done

if [ ! -z "$TRAVIS_TAG" ]
if [ -n "$TRAVIS_TAG" ]
then
echo "on a tag -> deploy release version $TRAVIS_TAG"
./gradlew $TARGETS -PreleaseMode=RELEASE
release_mode="RELEASE"
else
echo "not on a tag -> deploy snapshot version"
./gradlew $TARGETS -PreleaseMode=SNAPSHOT
release_mode="SNAPSHOT"
fi

./gradlew -PreleaseMode="$release_mode" publishToMavenLocal
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: ./gradlew build
run: ./gradlew build publishToMavenLocal
- name: Build sample
run: ./gradlew -p sample marathon --dry-run
46 changes: 0 additions & 46 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,49 +1,3 @@
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.kotlin.jvm") apply false
id("io.gitlab.arturbosch.detekt") apply false
}

allprojects {
group = "com.github.badoo.marathon"

plugins.withId("org.jetbrains.kotlin.jvm") {
plugins.apply("io.gitlab.arturbosch.detekt")

dependencies.add("implementation", dependencies.platform(Libraries.kotlinBom))
dependencies.add("implementation", dependencies.platform(Libraries.kotlinCoroutinesBom))
}

plugins.withId("java") {
extensions.configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withJavadocJar()
withSourcesJar()
}
}

plugins.withId("io.gitlab.arturbosch.detekt") {
configure<DetektExtension> {
buildUponDefaultConfig = true
config.from("$rootDir/detekt.yml")
}
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
freeCompilerArgs.addAll(
"-Xjvm-default=all",
"-opt-in=kotlin.RequiresOptIn"
)
}
}
}

tasks.register<Delete>("clean") {
delete(layout.buildDirectory)
}
15 changes: 15 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
plugins {
`java-gradle-plugin`
`kotlin-dsl`
}

repositories {
mavenCentral()
}

dependencies {
implementation(libs.detekt.gradle.plugin)
implementation(libs.kotlin.gradle.plugin)
}

gradlePlugin {
plugins {
create("marathonConventionsPlugin") {
id = "com.badoo.marathon.conventions"
implementationClass = "com.badoo.marathon.conventions.MarathonConventionsPlugin"
}
}
}
1 change: 1 addition & 0 deletions buildSrc/gradle/libs.versions.toml
68 changes: 0 additions & 68 deletions buildSrc/src/main/kotlin/Deployment.kt

This file was deleted.

24 changes: 0 additions & 24 deletions buildSrc/src/main/kotlin/Testing.kt

This file was deleted.

82 changes: 0 additions & 82 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

Loading

0 comments on commit 7c19e17

Please sign in to comment.