Skip to content

Commit cd675a0

Browse files
author
Kosh
committed
preparing mvn release
1 parent da1265d commit cd675a0

File tree

6 files changed

+41
-25
lines changed

6 files changed

+41
-25
lines changed

app/src/main/java/com/github/k0shk0sh/compose/easyforms/example/ui/MainActivity.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ import android.os.Bundle
44
import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
66
import androidx.activity.viewModels
7-
import androidx.compose.foundation.layout.*
7+
import androidx.compose.foundation.layout.Column
8+
import androidx.compose.foundation.layout.fillMaxSize
9+
import androidx.compose.foundation.layout.fillMaxWidth
10+
import androidx.compose.foundation.layout.padding
811
import androidx.compose.foundation.rememberScrollState
912
import androidx.compose.foundation.verticalScroll
1013
import androidx.compose.material.*
11-
import androidx.compose.runtime.*
14+
import androidx.compose.runtime.Composable
15+
import androidx.compose.runtime.mutableStateOf
1216
import androidx.compose.runtime.saveable.rememberSaveable
1317
import androidx.compose.ui.Modifier
1418
import androidx.compose.ui.tooling.preview.Preview
1519
import androidx.compose.ui.unit.dp
16-
import com.github.compose.easyforms.*
17-
import com.github.k0shk0sh.compose.easyforms.example.MainViewModel
18-
import com.github.k0shk0sh.compose.easyforms.example.model.listOfCheckboxes
19-
import com.github.compose.easyforms.example.ui.components.*
20-
import com.github.k0shk0sh.compose.easyforms.example.ui.theme.ComposeFormsValidationTheme
2120
import com.github.k0shk0sh.compose.easyforms.EasyForms
2221
import com.github.k0shk0sh.compose.easyforms.EasyFormsErrorState
22+
import com.github.k0shk0sh.compose.easyforms.example.MainViewModel
23+
import com.github.k0shk0sh.compose.easyforms.example.model.listOfCheckboxes
2324
import com.github.k0shk0sh.compose.easyforms.example.ui.components.*
25+
import com.github.k0shk0sh.compose.easyforms.example.ui.theme.ComposeFormsValidationTheme
2426

2527
class MainActivity : ComponentActivity() {
2628

build.gradle.kts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ buildscript {
99
dependencies {
1010
classpath(AppPlugins.AGP)
1111
classpath(AppPlugins.KGP)
12+
classpath(AppPlugins.PUBLISH)
1213
}
1314
}
1415

1516
plugins {
1617
id(AppPlugins.DOKKA) version DependenciesVersion.DOKKA_VERSION
17-
id(AppPlugins.PUBLISH) version DependenciesVersion.PUBLISH_VERSION
1818
id(AppPlugins.GITHUB_RELEASE) version DependenciesVersion.GITHUB_RELEASE_VERSION
1919
}
2020

@@ -36,7 +36,7 @@ subprojects {
3636
}
3737

3838
githubRelease {
39-
token("")
39+
token(System.getenv("GITHUB_TOKEN"))
4040
owner("k0shk0sh")
4141
repo("ComposeEasyForms")
4242
tagName("v1.0.0")
@@ -75,4 +75,13 @@ fun Project.configureDokka() {
7575
outputDirectory.set(file(DokkaConfig.OUTPUT_DIR))
7676
}
7777
}
78+
}
79+
80+
tasks.create("minorRelease") {
81+
dependsOn("nextMinor")
82+
project.afterEvaluate {
83+
dependsOn("publishToMavenLocal")
84+
}
85+
// .dependsOn("closeAndReleaseRepository")
86+
// .dependsOn("githubRelease")
7887
}

buildSrc/src/main/kotlin/LibVersion.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ data class LibVersion(
1111
fun LibVersion.increaseMajor() = this.copy(major = major + 1, minor = 0, patch = 0)
1212
fun LibVersion.increaseMinor() = this.copy(minor = minor + 1)
1313
fun LibVersion.increasePatch() = this.copy(minor = patch + 1)
14+
fun LibVersion.getLibVersion() = "$major.$minor.$patch"
1415
fun LibVersion.toMap(): Map<String, Int> = mapOf(
1516
"major" to major, "minor" to minor, "patch" to patch,
1617
)

buildSrc/src/main/kotlin/com/github/k0shk0sh/plugins/LibVersionPlugin.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import LibVersionProvider
66
import increaseMajor
77
import increaseMinor
88
import increasePatch
9+
import getLibVersion
910

1011
class LibVersionPlugin : Plugin<Project> {
1112
override fun apply(target: Project) {
@@ -64,7 +65,7 @@ class LibVersionPlugin : Plugin<Project> {
6465
project: Project,
6566
libFile: LibVersion,
6667
) {
67-
project.version = "${libFile.major}.${libFile.minor}.${libFile.patch}"
68+
project.version = libFile.getLibVersion()
6869
}
6970

7071
}

buildSrc/src/main/kotlin/configs.kt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,32 @@ object AppConfig {
99
val javaCompileOptions = JavaVersion.VERSION_1_8
1010
}
1111

12+
object DokkaConfig {
13+
const val MAIN = "main"
14+
const val SAMPLES = "app/src/main/java/"
15+
const val ANDROID_REF_URL = "https://developer.android.com/reference/"
16+
const val ANDROIDX_REF_URL = "https://developer.android.com/reference/androidx/package-list"
17+
const val ANDROID_KOTLIN_REF_URL = "https://developer.android.com/reference/kotlin/"
18+
const val ANDROIDX_KOTLIN_REF_URL =
19+
"https://developer.android.com/reference/kotlin/androidx/package-list"
20+
const val LOCAL_SRC_DIR = "src/main/java"
21+
const val REMOTE_SRC_DIR =
22+
"https://github.com/k0shk0sh/ComposeEasyForms/blob/main/%s/src/main/java"
23+
const val LINE_NUM = "#L"
24+
const val OUTPUT_DIR = "../docs"
25+
}
26+
1227
object AppPlugins {
1328
const val ANDROID_APP = "com.android.application"
1429
const val ANDROID_LIB = "com.android.library"
1530
const val KOTLIN_ANDROID = "kotlin-android"
1631
const val KOTLIN_PARCELIZE = "kotlin-parcelize"
1732
const val DOKKA = "org.jetbrains.dokka"
18-
const val PUBLISH = "com.vanniktech.maven.publish"
33+
const val PUBLISH_PLUGIN = "com.vanniktech.maven.publish"
1934
const val GITHUB_RELEASE = "com.github.breadmoirai.github-release"
2035
const val AGP = "com.android.tools.build:gradle:${DependenciesVersion.AGP_VERSION}"
2136
const val KGP = "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependenciesVersion.KGP_VERSION}"
37+
const val PUBLISH = "com.vanniktech:gradle-maven-publish-plugin:${DependenciesVersion.PUBLISH_VERSION}"
2238
}
2339

2440
object DependenciesVersion {
@@ -77,17 +93,4 @@ object AndroidTestDependencies {
7793
"androidx.test.espresso:espresso-core:${DependenciesVersion.ESPRESSO_CORE_VERSION}"
7894
const val COMPOSE_UI_TEST =
7995
"androidx.compose.ui:ui-test-junit4:${DependenciesVersion.COMPOSE_VERSION}"
80-
}
81-
82-
object DokkaConfig {
83-
const val MAIN = "main"
84-
const val SAMPLES = "app/src/main/java/"
85-
const val ANDROID_REF_URL = "https://developer.android.com/reference/"
86-
const val ANDROIDX_REF_URL = "https://developer.android.com/reference/androidx/package-list"
87-
const val ANDROID_KOTLIN_REF_URL ="https://developer.android.com/reference/kotlin/"
88-
const val ANDROIDX_KOTLIN_REF_URL = "https://developer.android.com/reference/kotlin/androidx/package-list"
89-
const val LOCAL_SRC_DIR = "src/main/java"
90-
const val REMOTE_SRC_DIR = "https://github.com/k0shk0sh/ComposeEasyForms/blob/main/%s/src/main/java"
91-
const val LINE_NUM = "#L"
92-
const val OUTPUT_DIR = "../docs"
9396
}

easyforms/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ dependencies {
6767
androidTestImplementation(AndroidTestDependencies.COMPOSE_UI_TEST)
6868
}
6969

70-
apply(plugin = AppPlugins.PUBLISH)
70+
apply { plugin(AppPlugins.PUBLISH_PLUGIN) }

0 commit comments

Comments
 (0)