Skip to content

Commit

Permalink
chore: migrate to gradle.kts, clean up build scripts (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
outadoc authored May 6, 2022
1 parent fdc7922 commit d306eae
Show file tree
Hide file tree
Showing 18 changed files with 232 additions and 355 deletions.
55 changes: 0 additions & 55 deletions build.gradle

This file was deleted.

84 changes: 84 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import com.diffplug.gradle.spotless.SpotlessExtension

plugins {
id("org.jetbrains.kotlinx.kover") version "0.5.0"
id("com.diffplug.gradle.spotless") version "6.2.0" apply false
id("org.jetbrains.kotlin.jvm") version "1.6.10" apply false
}

subprojects {
pluginManager.apply("com.diffplug.spotless")

configure<SpotlessExtension> {
kotlin {
ktlint()
licenseHeaderFile(rootProject.file("spotless.license.java.txt"))
}

kotlinGradle {
ktlint()
target("*.gradle.kts")
}
}

afterEvaluate {
tasks.withType<Test> {
testLogging {
events("passed", "skipped", "failed")
}
}
}

pluginManager.withPlugin("maven-publish") {
apply<JavaPlugin>()

version = extra["VERSION_NAME"] as String
group = extra["GROUP"] as String

configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
}

configure<PublishingExtension> {
publications {
create<MavenPublication>("maven") {
from(components["java"])

groupId = extra["GROUP"] as String
artifactId = extra["POM_ARTIFACT_ID"] as String
version = extra["VERSION_NAME"] as String

pom {
packaging = extra["POM_PACKAGING"] as String

name.set(extra["POM_NAME"] as String)
description.set(extra["POM_DESCRIPTION"] as String)
url.set(extra["POM_URL"] as String)

scm {
url.set(extra["POM_SCM_URL"] as String)
connection.set(extra["POM_SCM_CONNECTION"] as String)
developerConnection.set(extra["POM_SCM_DEV_CONNECTION"] as String)
}

licenses {
license {
name.set(extra["POM_LICENCE_NAME"] as String)
url.set(extra["POM_LICENCE_URL"] as String)
distribution.set(extra["POM_LICENCE_DIST"] as String)
}
}

developers {
developer {
id.set(extra["POM_DEVELOPER_ID"] as String)
name.set(extra["POM_DEVELOPER_NAME"] as String)
}
}
}
}
}
}
}
}
26 changes: 0 additions & 26 deletions deps.gradle

This file was deleted.

109 changes: 0 additions & 109 deletions gradle/gradle-mvn-push.gradle

This file was deleted.

14 changes: 14 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[libraries]
inject = "javax.inject:javax.inject:1"

kotlinpoet-core = "com.squareup:kotlinpoet:1.10.2"
kotlinpoet-ksp = "com.squareup:kotlinpoet-ksp:1.10.2"
ksp = "com.google.devtools.ksp:symbol-processing-api:1.6.10-1.0.4"

tp = "com.github.stephanenicolas.toothpick:toothpick:3.1.0"

junit4 = "junit:junit:4.13-beta-3"
compiletesting-kt = "com.github.tschuchortdev:kotlin-compile-testing:1.4.7"
compiletesting-ksp = "com.github.tschuchortdev:kotlin-compile-testing-ksp:1.4.7"
mockito = "org.mockito:mockito-core:2.4.0"
mockito_kotlin = "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 0 additions & 7 deletions settings.gradle

This file was deleted.

15 changes: 15 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rootProject.name = "toothpick-compiler-ksp-parent"

include(":toothpick-compiler-ksp")
include(":toothpick-compiler-ksp-core")
include(":toothpick-compiler-ksp-factory")
include(":toothpick-compiler-ksp-memberinjector")
include(":toothpick-compiler-test")

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
30 changes: 0 additions & 30 deletions toothpick-compiler-ksp-core/build.gradle

This file was deleted.

22 changes: 22 additions & 0 deletions toothpick-compiler-ksp-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.kotlin.jvm")
`maven-publish`
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
api(libs.inject)
api(libs.tp)

implementation(libs.ksp)

implementation(libs.kotlinpoet.core)
implementation(libs.kotlinpoet.ksp)
}
Loading

0 comments on commit d306eae

Please sign in to comment.