Skip to content

Commit

Permalink
Merge pull request #311 from DanielMartinus/enhancement/move-gradle-t…
Browse files Browse the repository at this point in the history
…o-kotlin-dsl

Move gradle build files of sample apps to kotlin dsl
  • Loading branch information
DanielMartinus authored Jul 15, 2023
2 parents 97bf6d4 + c54e69f commit b92ed9f
Show file tree
Hide file tree
Showing 23 changed files with 311 additions and 300 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci-konfetti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ jobs:
run-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v2
with:
java-version: 17
distribution: zulu

- uses: gradle/wrapper-validation-action@v1

Expand Down
11 changes: 0 additions & 11 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: "io.github.gradle-nexus.publish-plugin"

buildscript {
ext.konfetti_version = '2.0.3'
ext.kotlin_version = '1.8.10'
ext.compose_version = '1.4.3'
ext.coroutines_version = '1.4.2'
ext.konfetti_version = "2.0.3"
ext.kotlin_version = "1.8.10"
ext.compose_version = "1.4.3"
repositories {
maven { url "https://plugins.gradle.org/m2/" }
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.14.2"
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath("com.android.tools.build:gradle:8.0.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("com.github.dcendents:android-maven-gradle-plugin:2.1")
classpath("com.diffplug.spotless:spotless-plugin-gradle:5.14.2")
classpath("io.github.gradle-nexus:publish-plugin:1.1.0")
}
}

Expand Down
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
object Constants {
const val composeVersion = "1.4.3"
const val konfettiVersion = "2.0.3"
const val kotlinVersion = "1.8.10"
}
54 changes: 27 additions & 27 deletions konfetti/compose/build.gradle
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.diffplug.spotless'
id "com.android.library"
id "kotlin-android"
id "com.diffplug.spotless"
}

ext {
PUBLISH_GROUP_ID = 'nl.dionsegijn'
PUBLISH_GROUP_ID = "nl.dionsegijn"
PUBLISH_VERSION = konfetti_version
PUBLISH_ARTIFACT_ID = 'konfetti-compose'
PUBLISH_ARTIFACT_ID = "konfetti-compose"
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

spotless {
kotlin {
ktlint("0.37.2")
target 'src/**/*.kt'
target "src/**/*.kt"
}
java {
removeUnusedImports()
googleJavaFormat("1.5")
target '**/*.java'
target "**/*.java"
}
}

android {
compileSdkVersion 33
buildToolsVersion "34.0.0"
compileSdkVersion = 33
buildToolsVersion = "34.0.0"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "1.8"
}

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
minSdk = 21
targetSdk = 33

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
minifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

buildFeatures {
compose true
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerExtensionVersion = compose_version
}
namespace 'nl.dionsegijn.konfetti.compose'
namespace = "nl.dionsegijn.konfetti.compose"
}

dependencies {
debugApi project(path: ':konfetti:core')
releaseApi "nl.dionsegijn:konfetti-core:$konfetti_version"
debugApi(project(path: ":konfetti:core"))
releaseApi("nl.dionsegijn:konfetti-core:$konfetti_version")

implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation("androidx.compose.foundation:foundation:$compose_version")
implementation("androidx.compose.ui:ui:$compose_version")

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
}
40 changes: 20 additions & 20 deletions konfetti/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.diffplug.spotless'
id "com.android.library"
id "kotlin-android"
id "com.diffplug.spotless"
}

ext {
PUBLISH_GROUP_ID = 'nl.dionsegijn'
PUBLISH_GROUP_ID = "nl.dionsegijn"
PUBLISH_VERSION = konfetti_version
PUBLISH_ARTIFACT_ID = 'konfetti-core'
PUBLISH_ARTIFACT_ID = "konfetti-core"
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

spotless {
kotlin {
ktlint("0.37.2")
target 'src/**/*.kt'
target "src/**/*.kt"
}
java {
removeUnusedImports()
googleJavaFormat("1.5")
target '**/*.java'
target "**/*.java"
}
}

android {
compileSdkVersion 33
buildToolsVersion "34.0.0"
compileSdkVersion = 33
buildToolsVersion = "34.0.0"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "1.8"
}

defaultConfig {
minSdkVersion 15
targetSdkVersion 33
minSdk = 15
targetSdk = 33
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
namespace 'nl.dionsegijn.konfetti.core'
namespace = "nl.dionsegijn.konfetti.core"
lint {
abortOnError true
baseline file('lint-baseline.xml')
abortOnError = true
baseline(file("lint-baseline.xml"))
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.11.2'
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:3.11.2")
}
42 changes: 21 additions & 21 deletions konfetti/xml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "com.diffplug.spotless"

ext {
PUBLISH_GROUP_ID = 'nl.dionsegijn'
PUBLISH_GROUP_ID = "nl.dionsegijn"
PUBLISH_VERSION = konfetti_version
PUBLISH_ARTIFACT_ID = 'konfetti-xml'
PUBLISH_ARTIFACT_ID = "konfetti-xml"
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

spotless {
kotlin {
ktlint("0.37.2")
target 'src/**/*.kt'
target "src/**/*.kt"
}
java {
removeUnusedImports()
googleJavaFormat("1.5")
target '**/*.java'
target "**/*.java"
}
}

android {
compileSdkVersion 33
buildToolsVersion "34.0.0"
compileSdkVersion = 33
buildToolsVersion = "34.0.0"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = "1.8"
}

defaultConfig {
minSdkVersion 15
targetSdkVersion 33
minSdk = 15
targetSdk = 33
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
namespace 'nl.dionsegijn.konfetti.xml'
namespace = "nl.dionsegijn.konfetti.xml"
lint {
abortOnError true
baseline file('lint-baseline.xml')
abortOnError = true
baseline(file("lint-baseline.xml"))
}
}

dependencies {
debugApi project(path: ':konfetti:core')
releaseApi "nl.dionsegijn:konfetti-core:$konfetti_version"
debugApi(project(path: ":konfetti:core"))
releaseApi("nl.dionsegijn:konfetti-core:$konfetti_version")

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.11.2'
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:3.11.2")
}
Loading

0 comments on commit b92ed9f

Please sign in to comment.