-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vinogradov Andrey
committed
Dec 24, 2022
1 parent
fa4b3f2
commit 69cf0ed
Showing
11 changed files
with
99 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[versions] | ||
|
||
buildToolsVersion = "33.0.1" | ||
minSdk = "21" | ||
compileSdk = "33" | ||
|
||
kotlin = "1.7.22" | ||
appCompat = "1.5.1" | ||
coreKtx = "1.9.0" | ||
|
||
junit = "4.13.2" | ||
extJunit = "1.1.4" | ||
runner = "1.5.1" | ||
espressoCore = "3.5.0" | ||
mockito = "4.9.0" | ||
|
||
androidGradle = "7.3.1" | ||
publish = "0.22.0" | ||
dokka = "0.9.18" | ||
|
||
[libraries] | ||
# AndroidX | ||
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appCompat" } | ||
androidx-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } | ||
|
||
junit = { module = "junit:junit", version.ref = "junit" } | ||
runner = { module = "androidx.test:runner", version.ref = "runner" } | ||
extJunit = { module = "androidx.test.ext:junit", version.ref = "extJunit" } | ||
espressoCore = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" } | ||
mockito = { module = "org.mockito:mockito-android", version.ref = "mockito" } | ||
|
||
[plugins] | ||
# Android | ||
android-library = { id = "com.android.library", version.ref = "androidGradle" } | ||
android-gradle = { id = "com.android.tools.build:gradle", version.ref = "androidGradle" } | ||
|
||
# Kotlin | ||
kotlin-gradle = { id = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } | ||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | ||
kotlin-android-extensions = { id = "org.jetbrains.kotlin.android.extensions", version.ref = "kotlin" } | ||
|
||
# Other | ||
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } | ||
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,16 @@ | ||
apply plugin: "com.vanniktech.maven.publish" | ||
|
||
mavenPublish { | ||
def isRelease = isReleaseBuild() | ||
def signKeyValid = !getGpgKey().isEmpty() | ||
|
||
// useLegacyMode = !project.plugins.hasPlugin('org.jetbrains.kotlin.multiplatform') | ||
releaseSigningEnabled = isRelease | ||
|
||
project.logger.warn("publish: maven: release=$isRelease, keyValid=$signKeyValid") | ||
|
||
if (isRelease && !signKeyValid) { | ||
project.logger.error("Release signing enabled, but key is empty") | ||
} | ||
|
||
targets { | ||
installArchives { | ||
def url = file("${rootProject.buildDir}/localMaven").toURI().toString() | ||
project.logger.warn("publish: test: repo: $url") | ||
releaseRepositoryUrl = url | ||
snapshotRepositoryUrl = url | ||
publishing { | ||
repositories { | ||
maven { | ||
url = file("${rootProject.buildDir}/localMaven").toURI().toString() | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def key = getGpgKey() | ||
def pwd = getGpgPassword() | ||
if (!key.isEmpty()) { | ||
useInMemoryPgpKeys(key, pwd) | ||
mavenPublishing { | ||
pom { | ||
name.set("VK SDK Android") | ||
url.set("https://github.com/vksdk/vk-sdk-android") | ||
} | ||
} | ||
|
||
@SuppressWarnings("GrMethodMayBeStatic") | ||
Boolean isReleaseBuild() { | ||
return !VERSION_NAME.contains("SNAPSHOT") | ||
} | ||
|
||
def getGpgKey() { | ||
return hasProperty('signingKey') ? signingKey : "" | ||
} | ||
|
||
def getGpgPassword() { | ||
return hasProperty('signingPassword') ? signingPassword : "" | ||
} | ||
|
||
apply from: "$rootDir/gradle/dokka.gradle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters