Skip to content

Commit 8f7bc77

Browse files
author
Kosh
committed
prepare for releasing library
1 parent dc99a2d commit 8f7bc77

File tree

4 files changed

+39
-28
lines changed

4 files changed

+39
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Focus on building your form UI while the library do the heavy work for you.
2525

2626
Define `val easyForms = EasyForms()` in your ViewModel or in your Activity/Fragment upper in UI tree to prevent reinitializing the object.
2727

28-
> You should have always one instance of `EasyForms` in your Screen.
28+
> You should have always one instance of `EasyForms` per Screen.
2929
3030
**TextField example with Email validation:**
3131

build.gradle.kts

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.dokka.gradle.DokkaTask
12
import java.net.URL
23

34
buildscript {
@@ -12,7 +13,8 @@ buildscript {
1213
}
1314

1415
plugins {
15-
id("org.jetbrains.dokka") version "1.5.0"
16+
id(AppPlugins.DOKKA) version DependenciesVersion.DOKKA_VERSION
17+
id(AppPlugins.PUBLISH) version DependenciesVersion.PUBLISH_VERSION
1618
}
1719

1820
subprojects {
@@ -24,34 +26,38 @@ subprojects {
2426
}
2527
}
2628
afterEvaluate {
27-
if (plugins.hasPlugin(AppPlugins.DOKKA)) {
28-
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
29-
dokkaSourceSets {
30-
named("main") {
31-
failOnWarning.set(true)
32-
reportUndocumented.set(true)
33-
skipEmptyPackages.set(true)
34-
skipDeprecated.set(true)
35-
jdkVersion.set(8)
36-
noAndroidSdkLink.set(false)
37-
samples.from(rootProject.file("app/src/main/java/"))
38-
externalDocumentationLink {
39-
url.set(URL("https://developer.android.com/reference/"))
40-
packageListUrl.set(URL("https://developer.android.com/reference/androidx/package-list"))
41-
}
42-
externalDocumentationLink {
43-
url.set(URL("https://developer.android.com/reference/kotlin/"))
44-
packageListUrl.set(URL("https://developer.android.com/reference/kotlin/androidx/package-list"))
45-
}
46-
sourceLink {
47-
localDirectory.set(project.file("src/main/java"))
48-
remoteUrl.set(URL("https://github.com/k0shk0sh/ComposeEasyForms/blob/main/${project.name}/src/main/java"))
49-
remoteLineSuffix.set("#L")
50-
}
29+
configureDokka()
30+
}
31+
}
32+
33+
fun Project.configureDokka() {
34+
if (plugins.hasPlugin(AppPlugins.DOKKA)) {
35+
tasks.withType<DokkaTask>().configureEach {
36+
dokkaSourceSets {
37+
named("main") {
38+
failOnWarning.set(true)
39+
reportUndocumented.set(true)
40+
skipEmptyPackages.set(true)
41+
skipDeprecated.set(true)
42+
jdkVersion.set(8)
43+
noAndroidSdkLink.set(false)
44+
samples.from(rootProject.file("app/src/main/java/"))
45+
externalDocumentationLink {
46+
url.set(URL("https://developer.android.com/reference/"))
47+
packageListUrl.set(URL("https://developer.android.com/reference/androidx/package-list"))
48+
}
49+
externalDocumentationLink {
50+
url.set(URL("https://developer.android.com/reference/kotlin/"))
51+
packageListUrl.set(URL("https://developer.android.com/reference/kotlin/androidx/package-list"))
52+
}
53+
sourceLink {
54+
localDirectory.set(project.file("src/main/java"))
55+
remoteUrl.set(URL("https://github.com/k0shk0sh/ComposeEasyForms/blob/main/${project.name}/src/main/java"))
56+
remoteLineSuffix.set("#L")
5157
}
5258
}
53-
outputDirectory.set(file("../docs"))
5459
}
60+
outputDirectory.set(file("../docs"))
5561
}
5662
}
5763
}

buildSrc/src/main/kotlin/configs.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object AppPlugins {
1616
const val KOTLIN_ANDROID = "kotlin-android"
1717
const val KOTLIN_PARCELIZE = "kotlin-parcelize"
1818
const val DOKKA = "org.jetbrains.dokka"
19-
const val DOKKA_CLASSPATH = "org.jetbrains.dokka:dokka-gradle-plugin:1.5.0"
19+
const val PUBLISH = "com.vanniktech.maven.publish"
2020
const val AGP = "com.android.tools.build:gradle:${DependenciesVersion.AGP_VERSION}"
2121
const val KGP = "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependenciesVersion.KGP_VERSION}"
2222
}
@@ -34,6 +34,8 @@ object DependenciesVersion {
3434
const val TEST_EXT_VERSION = "1.1.3"
3535
const val ESPRESSO_CORE_VERSION = "3.4.0"
3636
const val MOCKITO_VERSION = "3.2.0"
37+
const val DOKKA_VERSION = "1.5.0"
38+
const val PUBLISH_VERSION = "0.18.0"
3739
}
3840

3941
object ComposeDependencies {

easyforms/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ android {
3030
jvmTarget = AppConfig.JVM_TARGET
3131
}
3232
buildFeatures {
33+
buildConfig = false
3334
compose = true
3435
}
3536
composeOptions {
@@ -65,3 +66,5 @@ dependencies {
6566
androidTestImplementation(AndroidTestDependencies.ESPRESSO_CORE)
6667
androidTestImplementation(AndroidTestDependencies.COMPOSE_UI_TEST)
6768
}
69+
70+
apply(plugin = AppPlugins.PUBLISH)

0 commit comments

Comments
 (0)