Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ google-services.json
*.hprof

.DS_Store
*yarn.lock
1 change: 1 addition & 0 deletions build-system/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies {
implementation(libs.base.gradle.spotless)
implementation(libs.base.gradle.nexusPublish)
implementation(libs.base.dokka.graddle)
implementation(libs.base.gradle.compose)
implementation(libs.base.dokka)

implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ subprojects {
}
println("requested module ${moduleSelector.module}")
when (moduleSelector.module) {
"sdds-uikit-compose" -> useTarget(
"sdds-core:uikit-compose:*",
"we work with the unreleased development version"
)
// "sdds-uikit-compose" -> useTarget(
// "sdds-core:uikit-compose:*",
// "we work with the unreleased development version"
// )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malilex и здесь тоже закомментированный код, надо удалить?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ответил выше


"sdds-uikit" -> useTarget(
"sdds-core:uikit:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
import utils.versionInfo
import utils.withVersionCatalogs

plugins {
id("com.android.application")
kotlin("multiplatform")
id("org.jetbrains.compose")
id("convention.detekt")
id("convention.spotless")
}

kotlin {
android {
withVersionCatalogs {
compilations.all {
kotlinOptions {
jvmTarget = versions.global.jvmTarget.get()
}
}
}
}
jvm("desktop")
}


android {
val vInfo = versionInfo()
// sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malilex почему закоммичен закомментированный код?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это ж wip, я запушил, чтобы другие могли оценить объем доработок при миграции.
вливать этот ПР мы еще не скоро будем, да и работа еще не закончена

withVersionCatalogs {
compileSdk = versions.global.compileSdk.get().toInt()

defaultConfig {
applicationVariants.all {
outputs.all {
val output = this as BaseVariantOutputImpl
output.outputFileName = output.outputFileName
.replace(".apk", "-${vInfo.fullArtifactName}.apk")
}
}
minSdk = versions.global.minSdk.get().toInt()
targetSdk = versions.global.targetSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
versionCode = vInfo.code
versionName = vInfo.name
versionNameSuffix = vInfo.nameSuffix

}
}

signingConfigs {
create("release") {
if (System.getenv("KEY_STORE_FILE") != null) {
storeFile = file(System.getenv("KEY_STORE_FILE"))
storePassword = System.getenv("RELEASE_STORE_PASSWORD")
keyAlias = System.getenv("RELEASE_KEY_ALIAS")
keyPassword = System.getenv("RELEASE_KEY_PASSWORD")
}
}
}

buildTypes {
release {
if (System.getenv("KEY_STORE_FILE") != null) {
signingConfig = signingConfigs.getByName("release")
}
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

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

lint {
xmlReport = false
textReport = false
sarifReport = false
htmlReport = true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import org.gradle.kotlin.dsl.kotlin
import utils.withVersionCatalogs

plugins {
id("com.android.library")
kotlin("multiplatform")
id("org.jetbrains.compose")
id("convention.detekt")
id("convention.spotless")
}

kotlin {
android {
publishLibraryVariants("release")
withVersionCatalogs {
compilations.all {
kotlinOptions {
jvmTarget = versions.global.jvmTarget.get()
}
}
}
}
jvm("desktop")
}

android {

withVersionCatalogs {
compileSdk = versions.global.compileSdk.get().toInt()

defaultConfig {
minSdk = versions.global.minSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}

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

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

lint {
xmlReport = false
textReport = false
sarifReport = false
htmlReport = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,37 @@ android {
}
}
}
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

publishing {
publications {
register<MavenPublication>("release") {
afterEvaluate { from(components["release"]) }
groupId = "io.github.salute-developers"
artifactId = nexusArtifactId
version = versionInfo.fullName
val siteUrl = findPropertyOrDefault("nexus.websiteUrl", "").toString()
val gitUrl = findPropertyOrDefault("nexus.gitUrl", "").toString()
publications.withType<MavenPublication> {
groupId = "io.github.salute-developers"
afterEvaluate { artifactId = nexusArtifactId() }
version = versionInfo.name
val siteUrl = findPropertyOrDefault("nexus.websiteUrl", "").toString()
val gitUrl = findPropertyOrDefault("nexus.gitUrl", "").toString()

pom {
name.set(artifactId)
description.set(findPropertyOrDefault("nexus.description", "").toString())
pom {
name.set(artifactId)
description.set(findPropertyOrDefault("nexus.description", "").toString())
url.set(siteUrl)
scm {
connection.set(gitUrl)
developerConnection.set(gitUrl)
url.set(siteUrl)
scm {
connection.set(gitUrl)
developerConnection.set(gitUrl)
url.set(siteUrl)
}
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/mit-license.php")
}
}
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/mit-license.php")
}
}

developers {
developer {
id.set("Salute Android Team")
name.set("Salute Android Team")
email.set("salutedevs@gmail.com")
}
developers {
developer {
id.set("Salute Android Team")
name.set("Salute Android Team")
email.set("salutedevs@gmail.com")
}
}
}
Expand All @@ -80,7 +71,7 @@ signing {
System.getenv("OSS_SIGNING_KEY"),
System.getenv("OSS_SIGNING_PASSWORD"),
)
sign(publishing.publications["release"])
sign(publishing.publications)

}

Expand Down Expand Up @@ -109,3 +100,15 @@ tasks.register<MavenPublishTask>("mavenPublish") {
artifact.set(File("${project.buildDir}/distributions/$distributionName.zip"))
dependsOn(tasks.first { it.name == "generateDistributionZip" })
}

fun MavenPublication.nexusArtifactId(): String {
println("picking artifact id for $name")
val isMultiplatformLib = project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")
return when {
!isMultiplatformLib -> nexusArtifactId
name.contains("android") -> "$nexusArtifactId-android"
name.contains("desktop") -> "$nexusArtifactId-desktop"
name.contains("kotlinMultiplatform") -> nexusArtifactId
else -> throw GradleException("Unsupported publication target $name")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
}
}

Expand Down
7 changes: 6 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ plugin-androidCacheFix = "3.0.1"
plugin-gradleNexusPublish = "1.3.0"
plugin-gradlePluginPublish = "1.2.1"
plugin-binary-compatibility-validator = "0.14.0"
plugin-compose="1.3.1"

plugin-dokka = "1.7.20"

Expand Down Expand Up @@ -100,6 +101,7 @@ base-gradle-paparazzi = { module = "app.cash.paparazzi:paparazzi-gradle-plugin",
base-gradle-spotless= { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "staticAnalysis-spotless" }
base-gradle-cacheFix= { module = "org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin", version.ref = "plugin-androidCacheFix" }
base-gradle-nexusPublish= { module = "io.github.gradle-nexus:publish-plugin", version.ref = "plugin-gradleNexusPublish" }
base-gradle-compose= { module = "org.jetbrains.compose:org.jetbrains.compose.gradle.plugin", version.ref = "plugin-compose" }

base-koil-compose = { module = "io.coil-kt:coil-compose", version.ref = "koilVersion-compose"}

Expand Down Expand Up @@ -131,4 +133,7 @@ gradlePluginPublish = { id = "com.gradle.plugin-publish", version.ref="plugin-gr
themebuilder = { id = "io.github.salute-developers.theme-builder-plugin" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref="plugin-binary-compatibility-validator" }
roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "test-roborazzi" }
dokka = { id = "org.jetbrains.dokka", version.ref = "plugin-dokka"}
dokka = { id = "org.jetbrains.dokka", version.ref = "plugin-dokka"}

jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "plugin-compose" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "global-kotlin" }
2 changes: 2 additions & 0 deletions playground/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.android.cache.fix) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.jetbrainsCompose) apply false
}

buildscript {
Expand Down
2 changes: 2 additions & 0 deletions sdds-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ plugins {
alias(libs.plugins.android.cache.fix) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.gradlePluginPublish) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.jetbrainsCompose) apply false
}

buildscript {
Expand Down
Loading
Loading