Skip to content

Commit

Permalink
Use pluginManagement dependencies (#254)
Browse files Browse the repository at this point in the history
* id 'com.android.application' version '7.0.4' apply false

* id 'org.jetbrains.kotlin.android' version '1.7.20' apply false

* id 'org.jetbrains.dokka' version '1.4.20'

* id 'io.codearte.nexus-staging' version '0.22.0'

* id "com.github.dcendents.android-maven" version "2.1" apply false

* Clean

* Fix: OVERRIDE_DEPRECATION warnings

* Update jacoco.toolVersion from 0.8.5 to 0.8.7 to fix "Unexpected SMAP line: *S KotlinDebug"

* Follow jacoco.toolVersion

* refactor build settings

* Use plugins block

* kotlin-android to org.jetbrains.kotlin.android

---------

Co-authored-by: Sojiro Nishimura <[email protected]>
  • Loading branch information
nkmrh and Sojiro Nishimura authored Feb 22, 2024
1 parent 9cdeb7f commit 2fa805e
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 58 deletions.
30 changes: 10 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,30 @@
buildscript {
ext.kotlin_version = '1.4.32'
ext.coroutine_version = '1.4.3'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.20"

// for upload maven repo
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0"

// for apply karte plugin to example project
classpath 'io.karte.android:local-gradle-plugin'
classpath 'com.google.gms:google-services:4.3.3'
}
}

plugins {
id 'com.android.application' version '7.0.4' apply false
id 'com.android.library' version '7.0.4' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'org.jetbrains.dokka' version '1.4.20'

// for upload maven repo
id "com.github.dcendents.android-maven" version "2.1" apply false
id 'io.codearte.nexus-staging' version '0.22.0'

id 'org.jetbrains.kotlinx.binary-compatibility-validator' version '0.13.2'
}

apiValidation {
ignoredProjects += ["test_lib", "sample_kotlin", "sample_java"]
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

configure(subprojects.findAll { !it.name.startsWith("sample_") && !it.name.startsWith("test") }) {
println "configure libraries: ${project.name}"

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: "jacoco"

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.7"
}

task jacocoMerge(
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/projectJacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tasks.withType(Test) {
}

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.7"
}

task jacocoTestReport(
Expand Down
6 changes: 4 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android'
Expand Down
15 changes: 4 additions & 11 deletions examples/sample_java/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
}
plugins {
id 'com.android.application'
id 'io.karte.android'
id 'com.google.gms.google-services'
}
apply plugin: 'com.android.application'
apply plugin: 'io.karte.android'

android {
compileSdkVersion 31
Expand Down Expand Up @@ -49,4 +43,3 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

apply plugin: 'com.google.gms.google-services'
19 changes: 6 additions & 13 deletions examples/sample_kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android-extensions'
id 'io.karte.android'
id 'com.google.gms.google-services'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.karte.android'

android {
compileSdkVersion 31
Expand Down Expand Up @@ -53,4 +47,3 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

apply plugin: 'com.google.gms.google-services'
6 changes: 4 additions & 2 deletions inappmessaging/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android.inappmessaging'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ internal abstract class BaseWebView(context: Context) : WebView(context.applicat
}

webViewClient = object : WebViewClient() {
@Deprecated("Deprecated in Java")
override fun shouldOverrideUrlLoading(webView: WebView, url: String): Boolean {
// 接客内callback用
if (url.startsWith(KARTE_CALLBACK_SCHEME)) return true
Expand Down Expand Up @@ -142,6 +143,7 @@ internal abstract class BaseWebView(context: Context) : WebView(context.applicat
}

// mainpageの失敗時のみ呼ばれる
@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
override fun onReceivedError(
view: WebView,
Expand Down
6 changes: 4 additions & 2 deletions inbox/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android.inbox'
Expand Down
6 changes: 4 additions & 2 deletions notifications/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android.notifications'
Expand Down
17 changes: 17 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

include ':core', ':inappmessaging', ':notifications', ':variables', ':visualtracking', ':inbox'
include ':sample_java', ':sample_kotlin', ':test_lib'
rootProject.name='Karte'
Expand Down
6 changes: 4 additions & 2 deletions variables/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android.variables'
Expand Down
6 changes: 4 additions & 2 deletions visualtracking/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'io.karte.android.visualtracking'
Expand Down

0 comments on commit 2fa805e

Please sign in to comment.