From 678dcdc09a5fbc2bbcd0d15c952fe3f6dcf5bc2a Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 18 Jun 2022 16:24:37 +0900 Subject: [PATCH 1/5] Migrate to maven publishing scripts --- .DS_Store | Bin 0 -> 10244 bytes .editorconfig | 5 + CODE_OF_CONDUCT.md | 128 ++++++++++++++++++ app/build.gradle | 75 +++++----- bindables/build.gradle | 87 ++++++------ build.gradle | 47 ++++--- buildSrc/.DS_Store | Bin 0 -> 6148 bytes buildSrc/build.gradle.kts | 7 + buildSrc/src/.DS_Store | Bin 0 -> 6148 bytes buildSrc/src/main/.DS_Store | Bin 0 -> 6148 bytes buildSrc/src/main/kotlin/.DS_Store | Bin 0 -> 6148 bytes buildSrc/src/main/kotlin/com/.DS_Store | Bin 0 -> 6148 bytes .../src/main/kotlin/com/skydoves/.DS_Store | Bin 0 -> 6148 bytes .../kotlin/com/skydoves/bindables/.DS_Store | Bin 0 -> 6148 bytes .../com/skydoves/bindables/Configuration.kt | 30 ++++ .../com/skydoves/bindables/Dependencies.kt | 46 +++++++ dependencies.gradle | 40 ------ gradle/wrapper/gradle-wrapper.properties | 2 +- scripts/publish-module.gradle | 87 ++++++++++++ scripts/publish-root.gradle | 45 ++++++ settings.gradle | 16 +++ spotless/.DS_Store | Bin 0 -> 6148 bytes spotless.gradle => spotless/spotless.gradle | 9 +- .../spotless.license.kt | 0 24 files changed, 478 insertions(+), 146 deletions(-) create mode 100644 .DS_Store create mode 100644 .editorconfig create mode 100644 CODE_OF_CONDUCT.md create mode 100644 buildSrc/.DS_Store create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/.DS_Store create mode 100644 buildSrc/src/main/.DS_Store create mode 100644 buildSrc/src/main/kotlin/.DS_Store create mode 100644 buildSrc/src/main/kotlin/com/.DS_Store create mode 100644 buildSrc/src/main/kotlin/com/skydoves/.DS_Store create mode 100644 buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store create mode 100644 buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt create mode 100644 buildSrc/src/main/kotlin/com/skydoves/bindables/Dependencies.kt delete mode 100644 dependencies.gradle create mode 100644 scripts/publish-module.gradle create mode 100644 scripts/publish-root.gradle create mode 100644 spotless/.DS_Store rename spotless.gradle => spotless/spotless.gradle (79%) rename spotless.license.kt => spotless/spotless.license.kt (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d1e15269063f676d4cebc27a7c57e17021fd824b GIT binary patch literal 10244 zcmeHMTW=dh6h4zU^_mn2Hwht-RssngLK8PBH0q0+I+ZGwg1T*a;1ayq#o2bfyRz39 zWCd9~a`_7tkG%211L76<3;Y)(B>2wEww;-EOdhJLpqXgq%+7pgF5jGUteFsz*d0f0 zBA{N25qzoM>w$UjwN10KKffGIn)Bpq71K&N97Q>3lz{7G{WdH4QPXI;e8;bG3qf| zH>gWJ^z~4?iSHOM2;6!bEip}i<=2Eh>a4+N*199tTHyOV^iQN#Kn2#E;g84ISiCc= z?^?CK1-rl)4Y1Q^ZcHxdBKpo~Tr}_D=nyLnE%c8T`ic8!u#6S+yGd;7h*vBfHNz0R zMBvXxe`BFnFhc@lOg(GdKP}`kMl7f>QA>Rb)uK?c8vz~i{4_E(BqMhZ=F9nYI!fbx^dz9{+)D? z%ILW1rEnn5BSbj*_EJspdBAQ2LTSLem&wVxrlP#8aBpu9|4f z7{Ukbcm$s^w3>94u7Jfo@EOpaIS0oU1HA?>&B0s`@&r4Qr=YK~Mb|OYMV#C_kn_%s zeNoqF;)D*sSOVtCS}eH?^yeA}7FzS$Umm&NzBHY_**?Dw&)quPmY#cV6JET%V|nhk zup6XfJ@-3wTKls6<7sddgB`Xi{taAc(`;o1!yfPjPPJ6gy2kNO7RNQb#`1qVI$Au; zjgA&ZkB&clb@%1M|4l{58ty@KT!fn&9j&pf)0fuc3dewBz%k$$a11Cyi)fbXxyo!;I5-TfaAeJ6Ui`(NDu{{bEBM700_ literal 0 HcmV?d00001 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..376f7bb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true +[*] +# Most of the standard properties are supported +indent_size=2 +max_line_length=100 \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..1c1cab1 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +skydoves2@gmail.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/app/build.gradle b/app/build.gradle index 30bbd72..e4d7549 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,52 +13,51 @@ // * See the License for the specific language governing permissions and // * limitations under the License. // */ + +import com.skydoves.bindables.Configuration +import com.skydoves.bindables.Dependencies + plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-parcelize' - id 'dagger.hilt.android.plugin' + id "com.android.application" + id "org.jetbrains.kotlin.android" + id "kotlin-kapt" + id "kotlin-parcelize" + id "dagger.hilt.android.plugin" } android { - compileSdkVersion versions.compileSdk - defaultConfig { - applicationId "com.skydoves.bindablesdemo" - minSdkVersion versions.minSdkDemo - targetSdkVersion versions.compileSdk - versionCode versions.versionCode - versionName versions.versionName - } - lintOptions { - abortOnError false - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } - buildFeatures { - dataBinding true - } -} + compileSdkVersion Configuration.compileSdk + defaultConfig { + applicationId "com.skydoves.bindablesdemo" + minSdkVersion Configuration.minSdk + targetSdkVersion Configuration.targetSdk + versionCode Configuration.versionCode + versionName Configuration.versionName + } -dependencies { - implementation "com.google.android.material:material:$versions.googleMaterial" - implementation "androidx.fragment:fragment-ktx:$versions.fragmentVersion" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } - implementation "com.github.bumptech.glide:glide:$versions.glideVersion" - kapt "com.github.bumptech.glide:compiler:$versions.glideVersion" + kotlinOptions { + jvmTarget = '1.8' + } - implementation "com.google.dagger:hilt-android:$versions.hiltCoreVersion" - kapt "com.google.dagger:hilt-compiler:$versions.hiltCoreVersion" - kapt "androidx.hilt:hilt-compiler:$versions.hiltVersion" + buildFeatures { + dataBinding true + } +} - implementation "com.github.skydoves:whatif:$versions.whatIfVersion" +dependencies { + implementation project(":bindables") - implementation project(":bindables") + implementation Dependencies.material + implementation Dependencies.fragment + implementation Dependencies.glide + implementation Dependencies.hilt + kapt Dependencies.hiltCompiler + implementation Dependencies.whatIf } -apply from: "$rootDir/spotless.gradle" \ No newline at end of file +apply from: "$rootDir/spotless/spotless.gradle" \ No newline at end of file diff --git a/bindables/build.gradle b/bindables/build.gradle index 0415cf8..4644b46 100644 --- a/bindables/build.gradle +++ b/bindables/build.gradle @@ -13,58 +13,67 @@ // * See the License for the specific language governing permissions and // * limitations under the License. // */ + +import com.skydoves.bindables.Configuration +import com.skydoves.bindables.Dependencies + plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'org.jetbrains.dokka' - id 'binary-compatibility-validator' + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'org.jetbrains.dokka' + id 'binary-compatibility-validator' +} + +ext { + PUBLISH_GROUP_ID = Configuration.artifactGroup + PUBLISH_ARTIFACT_ID = 'bindables' + PUBLISH_VERSION = rootVersionName } -apply from: "$rootDir/dependencies.gradle" +apply from: "${rootDir}/scripts/publish-module.gradle" android { - compileSdkVersion versions.compileSdk - defaultConfig { - minSdkVersion versions.minSdk - targetSdkVersion versions.compileSdk - versionCode versions.versionCode - versionName versions.versionName - consumerProguardFiles "consumer-rules.pro" - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } - buildFeatures { - buildConfig false - dataBinding true - } + compileSdkVersion Configuration.compileSdk + defaultConfig { + minSdkVersion Configuration.minSdk + targetSdkVersion Configuration.targetSdk + versionCode Configuration.versionCode + versionName Configuration.versionName + consumerProguardFiles "consumer-rules.pro" + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + buildConfig false + dataBinding true + } } apiValidation { - ignoredPackages += [ - "com/skydoves/bindables/databinding", - ] - nonPublicMarkers += [ - "kotlin.PublishedApi", - ] + ignoredPackages += [ + "com/skydoves/bindables/databinding", + ] + nonPublicMarkers += [ + "kotlin.PublishedApi", + ] } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions.freeCompilerArgs += ["-Xexplicit-api=strict"] + kotlinOptions.freeCompilerArgs += ["-Xexplicit-api=strict"] } dependencies { - implementation "org.jetbrains.kotlin:kotlin-reflect:$versions.kotlin" - implementation "com.google.android.material:material:$versions.googleMaterial" - implementation "androidx.appcompat:appcompat:$versions.androidxAppcompat" - api "androidx.lifecycle:lifecycle-viewmodel-ktx:$versions.lifecycleVersion" - api "androidx.lifecycle:lifecycle-viewmodel-savedstate:$versions.lifecycleVersion" + implementation Dependencies.kotlinReflect + implementation Dependencies.material + implementation Dependencies.appcompat + api Dependencies.viewModelKtx + api Dependencies.viewModelSavedState } -apply plugin: "com.vanniktech.maven.publish" -apply from: "$rootDir/spotless.gradle" \ No newline at end of file +apply from: "$rootDir/spotless/spotless.gradle" \ No newline at end of file diff --git a/build.gradle b/build.gradle index ef4f6a7..1e41163 100644 --- a/build.gradle +++ b/build.gradle @@ -13,32 +13,31 @@ // * See the License for the specific language governing permissions and // * limitations under the License. // */ + +import com.skydoves.bindables.Dependencies + +apply plugin: "io.github.gradle-nexus.publish-plugin" +apply plugin: "org.jetbrains.dokka" + buildscript { - apply from: "$rootDir/dependencies.gradle" - repositories { - google() - mavenCentral() - jcenter() - } - dependencies { - classpath "com.android.tools.build:gradle:$versions.gradleBuildTool" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" - classpath "com.google.dagger:hilt-android-gradle-plugin:$versions.hiltCoreVersion" - classpath "com.diffplug.spotless:spotless-plugin-gradle:$versions.spotlessGradle" - classpath "com.vanniktech:gradle-maven-publish-plugin:$versions.mavenPublish" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokkaGradle" - classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$versions.binaryValidator" - } + repositories { + google() + mavenCentral() + maven { url "https://plugins.gradle.org/m2/" } + } + dependencies { + classpath Dependencies.androidGradlePlugin + classpath Dependencies.kotlinGradlePlugin + classpath Dependencies.spotlessGradlePlugin + classpath Dependencies.gradleNexusPublishPlugin + classpath Dependencies.dokka + classpath Dependencies.hiltPlugin + classpath Dependencies.kotlinBinaryValidator + } } -allprojects { - repositories { - google() - mavenCentral() - jcenter() - } +task clean(type: Delete) { + delete rootProject.buildDir } -task clean(type: Delete) { - delete rootProject.buildDir -} \ No newline at end of file +apply from: "${rootDir}/scripts/publish-root.gradle" \ No newline at end of file diff --git a/buildSrc/.DS_Store b/buildSrc/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5236b6119bcad9b2df1066ba9b42b396c29b1578 GIT binary patch literal 6148 zcmeHK%}&BV5S|6p5@OPWCLTBON)W`~c&Ug7uh!^64YrnGL+uh;0BiuTP$lMy*nA^$Uh0hGjHQ6c)EWU)paXsI zAeiwc!#pw|&&~!P1`tAor}lY%5wvmCg%pyLNZk67@RcvXA!6lCiP};g5Cpd)Ts9 zjzpY#VchPkfG}vI%hg2~2V&R|gE&Z3tg9!iqE&3!YopO-y$;uAB#t|D`5CdD_J%;fhX*kJwLepI1+IOEfepF7a=h~3=jkJ%YeDD ztkV3xBE1S5Z-O0O({YT3Oz1(E!x`pQ@q4l4_=MvL8T_9XfVx|{+L54ijPdp)s54e(jM<=wxgreT2(F_pNX}UDfE@QYjpUsl zNgtkZLz4f`0G^%2`pjb?i@%)T5v*;!D^ZEe{rqG!Fz5X052A21uGQXnE^n=@7VLsu zvTxi6nYd$bJQ=mU;T1leOBwmu-19HOUeYbEAIo^`g>i4F0>YpNF4vb~9LS_CCvh-R zv94aQi*~VFu1u#pjYd`M?zd)DF>N*LRngo#n9Yjz#^(0nS@$vO$MRWI&*8gNvSu)Y z7nscRd2)wwB;$LqW&W8TAu&J<5ChA|fVu1J(lRDTIS~WIz^@p<`$2#rItEjX>gs?& zwE%z?n3cd>{rUq6GypmVQ;lE&;W`vhhjP;fl%j=@wTSU~7UK+!-0G4Q7hd;oxSRK)-Q literal 0 HcmV?d00001 diff --git a/buildSrc/src/main/.DS_Store b/buildSrc/src/main/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4b3783d68af1d52d6e1a30832e44f4bcff4316ed GIT binary patch literal 6148 zcmeHK%}&BV5S|5u5@NzZ6ONmBB?^K+#7jjyc(q0kYLE)ihT0`ix(H zT}%jiGscjaWait>&a|Cxo81loh~~Ik1tzUJ}8JGgvIrvkK!10`$LO<{e@V6G8)*me)9)mFp4XccachG*0MP# z=M*>xD$^@&Cc+et}c`c{rR}#Uk1HNySQW*}-XC|DylW!MG)9G%lR+f7QjagYv8}({g*7px*v%IspwR3dd?uSp2deLtU0>4i! z>lWwmii3rkp1olds^|gz^PG7sBQwAZFaxW?fZgAm!m1R+bua_Wz^^et`-4O!bS)+Z z_11w#w*ZJ4bZfye{WemLwCGw)4B`xmFsXS5Z-O8O(;SS3OxqA7Hw_)DPCf%2d_r-pi+~zXfVx|CN+mr$XQ>=C-HT3 zW_Kf$>cxX#nSt4FGdr_kz70DW#u#^|gC=8D#+U($STJGuMsOW*%euz2{t+p7tZelR(3w5$V9Z4pT=W-%5VNS4C18Gc;|&;X>Gl1l#PmU z=RS(mO}u0pJKp35pDu+6{e15ESHUptRX0yXlz2fjoXCJ+Fa(#|>mVA4)DhEY5X)Fs zEf}U@_NuknY_HX-Tl5ud6e%-efEf5C19(4Jpoq4{Org9wV2~{U zU$djK6smB><(pw2{bsH^6s}tj zZb^5>ZG|)v1H`~01K9h4RI&b_{oMacCmM(WVqi5H;H9qHbs#rgTbHuLT5EycgQB2c nrtm8SCbATRFP7pOs1&eUI03XZW(vUqLO%kM1{#QgKV{$($AMDY literal 0 HcmV?d00001 diff --git a/buildSrc/src/main/kotlin/com/.DS_Store b/buildSrc/src/main/kotlin/com/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d421a8f7f04154fa3bd3c878ab37317928cb77f5 GIT binary patch literal 6148 zcmeHKOH0E*5T0$T-BN@e6nb3nTJTYy=pod4@M=U4Dz!01gE1>jA4nOeG~!$dn@>RFWK+mFPaavAduSLy2hxLB zUrt4{<2NcmYbPOv8@PuM-mPB{>j1~-!`MYze{uLMJ{YEVF8(RFi=(u+y! zQ5I!cp8MB&==a*ae%fevPwDDN>o}P7+re?v8MZ3(dpha0qomU{2~pU=kh7C03H7j{ z`$?FZT;C4Jk}S0<)zN6RUazV3&FyhbjkecTYHDp`YdkK=g~g?v!`4lFo9G98Z-l__ z)L_o>gdVXorNhAQCb3SgaBPw{iDza7SOHexFDu~oG+F-3li+t}1z3S^QGoUbg+}Z- z&Mcd)0~=EUAQ#YWfPMO9q#WhgbDUYm5rnX*$Tn5D5<}Q@^eY$VInFHGbP%ri5bnvs zRVczd9q+G9I0(-&x2ymw@KFJ({SXy8|M$PH|4k4#tN<(UKNS##rr&Jf+}znZHA^~c t71{+Ff#NdDZz(*+oqEIZ& z%+5J;PT9HiZ&ly#2HjrP2s-CSBGiz9f(V1gEpekV;-dV`}Q=7_<_3a|pKz;r5LcQdCvozv%8vjVKZ4=OU=vmAS;s}~BR767+w!{#Ij{VZ+c@}enh7Q6OAHqIa z*a}7Hr{n#lP6y!`dkwI5oA&i}*j>wlfZ4J*J3{7(f$sp&Tx_-^)W9eYbU vYbE*>IvM5V20thm=%W~O=_p=8*M|L)0z}VZZV-FW_(wp?zzr+#s|vgW2!2{u literal 0 HcmV?d00001 diff --git a/buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store b/buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..545df4597073053020f1e91dc1a942817ba98d68 GIT binary patch literal 6148 zcmeHK%TB{E5FA4fl{kYEWtK`60d$W_ArCkaLC5uH+qi zUyetL9{|$iu($>)0An^`QfEM99(0|QU}3TvD?H27-a3 zF~BohGCp$*9Sj5m!N3;-+8;8TurAm++SWm(>$ChLp@er?WP*J+Mg>*QrBczjq1XK>NsrIo+StXIx#db5s@CEu9z_ N0V5<-FmMD0J^%xzEZzVB literal 0 HcmV?d00001 diff --git a/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt b/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt new file mode 100644 index 0000000..a75f404 --- /dev/null +++ b/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2021 skydoves + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.skydoves.bindables + +object Configuration { + const val compileSdk = 32 + const val targetSdk = 32 + const val minSdk = 16 + const val majorVersion = 1 + const val minorVersion = 1 + const val patchVersion = 0 + const val versionName = "$majorVersion.$minorVersion.$patchVersion" + const val versionCode = 11 + const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT" + const val artifactGroup = "com.github.skydoves" +} diff --git a/buildSrc/src/main/kotlin/com/skydoves/bindables/Dependencies.kt b/buildSrc/src/main/kotlin/com/skydoves/bindables/Dependencies.kt new file mode 100644 index 0000000..b07bbfc --- /dev/null +++ b/buildSrc/src/main/kotlin/com/skydoves/bindables/Dependencies.kt @@ -0,0 +1,46 @@ +package com.skydoves.bindables + +object Versions { + internal const val ANDROID_GRADLE_PLUGIN = "7.2.1" + internal const val ANDROID_GRADLE_SPOTLESS = "6.3.0" + internal const val GRADLE_NEXUS_PUBLISH_PLUGIN = "1.1.0" + internal const val KOTLIN = "1.7.0" + internal const val KOTLIN_GRADLE_DOKKA = "1.6.21" + internal const val KOTLIN_BINARY_VALIDATOR = "0.10.1" + + internal const val APPCOMPAT = "1.4.1" + internal const val MATERIAL = "1.6.0" + internal const val LIFECYCLE = "2.4.1" + + internal const val FRAGMENT = "1.2.5" + internal const val HILT = "2.42" + internal const val GLIDE = "4.13.0" + internal const val WHATIF = "1.1.1" +} + +object Dependencies { + const val androidGradlePlugin = + "com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}" + const val gradleNexusPublishPlugin = + "io.github.gradle-nexus:publish-plugin:${Versions.GRADLE_NEXUS_PUBLISH_PLUGIN}" + const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}" + const val spotlessGradlePlugin = + "com.diffplug.spotless:spotless-plugin-gradle:${Versions.ANDROID_GRADLE_SPOTLESS}" + const val dokka = "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.KOTLIN_GRADLE_DOKKA}" + const val kotlinBinaryValidator = + "org.jetbrains.kotlinx:binary-compatibility-validator:${Versions.KOTLIN_BINARY_VALIDATOR}" + + const val appcompat = "androidx.appcompat:appcompat:${Versions.APPCOMPAT}" + const val material = "com.google.android.material:material:${Versions.MATERIAL}" + const val lifecycle = "androidx.lifecycle:lifecycle-common-java8:${Versions.LIFECYCLE}" + const val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.KOTLIN}" + const val viewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.LIFECYCLE}" + const val viewModelSavedState = "androidx.lifecycle:lifecycle-viewmodel-savedstate:${Versions.LIFECYCLE}" + + const val fragment = "androidx.fragment:fragment-ktx:${Versions.FRAGMENT}" + const val hilt = "com.google.dagger:hilt-android:${Versions.HILT}" + const val hiltCompiler = "com.google.dagger:hilt-compiler:${Versions.HILT}" + const val hiltPlugin = "com.google.dagger:hilt-android-gradle-plugin:${Versions.HILT}" + const val glide = "com.github.bumptech.glide:glide:${Versions.GLIDE}" + const val whatIf = "com.github.skydoves:whatif:${Versions.WHATIF}" +} diff --git a/dependencies.gradle b/dependencies.gradle deleted file mode 100644 index e76f2c2..0000000 --- a/dependencies.gradle +++ /dev/null @@ -1,40 +0,0 @@ -// Designed and developed by 2021 skydoves (Jaewoong Eum) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -ext.versions = [ - minSdk : 16, - minSdkDemo : 21, - compileSdk : 31, - versionCode : 10, - versionName : '1.0.9', - - gradleBuildTool : '7.0.2', - spotlessGradle : '6.1.0', - ktlintGradle : '0.41.0', - dokkaGradle : '1.4.32', - binaryValidator : '0.7.1', - mavenPublish : '0.15.1', - - kotlin : '1.5.32', - androidxAppcompat: '1.4.0', - googleMaterial : '1.4.0', - lifecycleVersion : '2.4.0', - - // for demo - fragmentVersion : '1.2.5', - hiltCoreVersion : '2.40.5', - hiltVersion : '1.0.0', - glideVersion : '4.12.0', - whatIfVersion : '1.1.0', -] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2b24020..6fb5ae0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -16,4 +16,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip diff --git a/scripts/publish-module.gradle b/scripts/publish-module.gradle new file mode 100644 index 0000000..ea8ce59 --- /dev/null +++ b/scripts/publish-module.gradle @@ -0,0 +1,87 @@ +apply plugin: 'maven-publish' +apply plugin: 'signing' +apply plugin: 'org.jetbrains.dokka' + +task androidSourcesJar(type: Jar) { + archiveClassifier.set('sources') + if (project.plugins.findPlugin("com.android.library")) { + from android.sourceSets.main.java.srcDirs + from android.sourceSets.main.kotlin.srcDirs + } else { + from sourceSets.main.java.srcDirs + from sourceSets.main.kotlin.srcDirs + } +} + +tasks.withType(dokkaHtmlPartial.getClass()).configureEach { + pluginsMapConfiguration.set( + ["org.jetbrains.dokka.base.DokkaBase": """{ "separateInheritedMembers": true}"""] + ) +} + +task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { + archiveClassifier.set('javadoc') + from dokkaJavadoc.outputDirectory +} + +artifacts { + archives androidSourcesJar + archives javadocJar +} + +group = PUBLISH_GROUP_ID +version = PUBLISH_VERSION + +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + groupId PUBLISH_GROUP_ID + artifactId PUBLISH_ARTIFACT_ID + version PUBLISH_VERSION + if (project.plugins.findPlugin("com.android.library")) { + from components.release + } else { + from components.java + } + + artifact androidSourcesJar + artifact javadocJar + + pom { + name = PUBLISH_ARTIFACT_ID + description = 'Android DataBinding kit for notifying data changes to UI layers.' + url = 'https://github.com/skydoves/bindables' + licenses { + license { + name = 'The Apache Software License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id = 'skydoves' + name = 'Jaewoong Eum' + email = "skydoves2@gmail.com" + url = "https://github.com/skydoves" + } + } + scm { + connection = 'scm:git:github.com/skydoves/bindables.git' + developerConnection = 'scm:git:ssh://github.com/skydoves/bindables.git' + url = 'https://github.com/skydoves/bindables/tree/main' + } + } + } + } + } +} + +signing { + useInMemoryPgpKeys( + rootProject.ext["signing.keyId"], + rootProject.ext["signing.key"], + rootProject.ext["signing.password"], + ) + sign publishing.publications +} diff --git a/scripts/publish-root.gradle b/scripts/publish-root.gradle new file mode 100644 index 0000000..84ef429 --- /dev/null +++ b/scripts/publish-root.gradle @@ -0,0 +1,45 @@ +import com.skydoves.bindables.Configuration + +// Create variables with empty default values +ext["ossrhUsername"] = '' +ext["ossrhPassword"] = '' +ext["sonatypeStagingProfileId"] = '' +ext["signing.keyId"] = '' +ext["signing.password"] = '' +ext["signing.key"] = '' +ext["snapshot"] = '' + +File secretPropsFile = project.rootProject.file('local.properties') +if (secretPropsFile.exists()) { + // Read local.properties file first if it exists + Properties p = new Properties() + new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) } + p.each { name, value -> ext[name] = value } +} else { + // Use system environment variables + ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') + ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') + ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') + ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') + ext["signing.password"] = System.getenv('SIGNING_PASSWORD') + ext["signing.key"] = System.getenv('SIGNING_KEY') + ext["snapshot"] = System.getenv('SNAPSHOT') +} + +if (snapshot) { + ext["rootVersionName"] = Configuration.snapshotVersionName +} else { + ext["rootVersionName"] = Configuration.versionName +} + +// Set up Sonatype repository +nexusPublishing { + repositories { + sonatype { + stagingProfileId = sonatypeStagingProfileId + username = ossrhUsername + password = ossrhPassword + version = rootVersionName + } + } +} diff --git a/settings.gradle b/settings.gradle index 38b0114..50d83d3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,6 +13,22 @@ // * See the License for the specific language governing permissions and // * limitations under the License. // */ + +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + include ':bindables' include ':app' rootProject.name = "BindablesDemo" \ No newline at end of file diff --git a/spotless/.DS_Store b/spotless/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6966dc111025ec4a7f8b81b6d919691dd0c2b21f GIT binary patch literal 6148 zcmeHK%SuBr5IxZ@3N9?TahWeD_y@7ng=>F6`#{7?uV~%p&-I+lsJ(dCMP#OAPBO3L z9%vo_(&Bw{1hLo)M|9t;*GyK9!CoOMU&Qk&K19)#~z34f5ihf zvfOt4de!wSMvA6uw)saB_JE6#><&*@lZzdFTe9(t{b3c${?V;Ys9+!%2nK?IVBk0m z@XVG>&kREc1HnKr@Xdhshs-7{j@7Vj9aOqL%RdoH*w-alm>r8_HKd1 z(rM2gR~)OMr6aYOS;uGodc34IJMFoJBNfBY!9XxDWZ=|>GoAl8{L73!@`oug3I>9K zf5t$XEbo>Jew3fBzdlcAZDzY?lPIpLLt%e#3E)8c$YpbyKdaBU;#dt;MfR3XjEg`c LBvdeP1O`3<^^Z3^ literal 0 HcmV?d00001 diff --git a/spotless.gradle b/spotless/spotless.gradle similarity index 79% rename from spotless.gradle rename to spotless/spotless.gradle index 4a2ff38..db2d1dd 100644 --- a/spotless.gradle +++ b/spotless/spotless.gradle @@ -13,13 +13,14 @@ // limitations under the License. apply plugin: "com.diffplug.spotless" -apply from: '../dependencies.gradle' + spotless { kotlin { target "**/*.kt" - ktlint("$versions.ktlintGradle").userData(['indent_size': '2', 'continuation_indent_size': '2']) - licenseHeaderFile "$rootDir/spotless.license.kt" + targetExclude "**/build/**/*.kt" + ktlint().userData(['indent_size': '2', 'continuation_indent_size': '2']) + licenseHeaderFile "$rootDir/spotless/spotless.license.kt" trimTrailingWhitespace() endWithNewline() } -} +} \ No newline at end of file diff --git a/spotless.license.kt b/spotless/spotless.license.kt similarity index 100% rename from spotless.license.kt rename to spotless/spotless.license.kt From 11f043168090bbc2afa06c546965b5c4ba4154a9 Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 18 Jun 2022 16:25:16 +0900 Subject: [PATCH 2/5] Update gitignore --- .DS_Store | Bin 10244 -> 10244 bytes .gitignore | 3 +++ 2 files changed, 3 insertions(+) diff --git a/.DS_Store b/.DS_Store index d1e15269063f676d4cebc27a7c57e17021fd824b..3c8091dcd304b38c3c5467e21ed42c1eb1df725b 100644 GIT binary patch delta 66 zcmV-I0KNZ&P=rvBPXQ^hP`eKSDYFa^DFTxZ5(kqC6UP$+0AT=d0C09wa&ByIZf5`h Y00FZy67dYP2O# Date: Sat, 18 Jun 2022 16:27:19 +0900 Subject: [PATCH 3/5] Remove unused files --- .DS_Store | Bin 10244 -> 0 bytes buildSrc/.DS_Store | Bin 6148 -> 0 bytes buildSrc/src/.DS_Store | Bin 6148 -> 0 bytes buildSrc/src/main/.DS_Store | Bin 6148 -> 0 bytes buildSrc/src/main/kotlin/.DS_Store | Bin 6148 -> 0 bytes buildSrc/src/main/kotlin/com/.DS_Store | Bin 6148 -> 0 bytes buildSrc/src/main/kotlin/com/skydoves/.DS_Store | Bin 6148 -> 0 bytes .../kotlin/com/skydoves/bindables/.DS_Store | Bin 6148 -> 0 bytes 8 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store delete mode 100644 buildSrc/.DS_Store delete mode 100644 buildSrc/src/.DS_Store delete mode 100644 buildSrc/src/main/.DS_Store delete mode 100644 buildSrc/src/main/kotlin/.DS_Store delete mode 100644 buildSrc/src/main/kotlin/com/.DS_Store delete mode 100644 buildSrc/src/main/kotlin/com/skydoves/.DS_Store delete mode 100644 buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 3c8091dcd304b38c3c5467e21ed42c1eb1df725b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10244 zcmeHM&2Jk;6n~RA^_mn2UlKw^S_uvyrA^$VA5kxE>Qt&!3hK7yKxyjDF3z^=-Icw@ zAS=k?2<2a>ICA5{0dWQX1^yQ#r1tk_Htp=JV|udMYR1}mvopUpAHVnJt!7L_VtW`g ziCiLb@UUDtj%-Tec77^pp{V&7Qb3<5roRrIM&528>N z#Sud&b+o$-hinycqNGwMq0~tfBa7mMBIM}Mb0wTaOG%qs1}p|uGt2#}!$IB$?gDxAEe+6nNIhDkTeu&HX^3)& z+BIrZ2W=gcZsI+}4FcERLrq8{VEHzoi!y64nzioBxn_9(4DBPSYh2bb+GD=w>F!r?&jI^2L}!3oe$P7T;IJP_mcDn z%p6G+p9=VQIWbekn!on?Nt`CURz^3-mmU;=5uZ7xL75e4^@p0(mw+2WC#Jwavc+}e z@ux^>`=jj0R@e0$P0!=owemOu))e1qGpgWU5{p&V6?dE7UfRpR*I}w)dTF~|c&l^g z-p{qa|NE2o?G#+_Ot@_S|Hm|Z>P@;tpCW4Q&@SX<B54JE zjt#nwkuJh=pFmEt8}CJ3qYex0fw2h8<&{`+8R%~`4h*!mZ~vHkq zH-qB}USs)1{+?CVH8naKTM#ovWsnOBs%doz3ADdeSECZGS z%fLJtSX6_#%aA)q|NlSFDcP|s1D1g~Gazbhuf2^y`3huO;=6Vi&s{v67&lQ;svwis u@sRR59xr?y{}CR>uCwHXa;uONB~gPk_df&d`QN-fwCDfIUEj-n{(lSuaDN~G diff --git a/buildSrc/.DS_Store b/buildSrc/.DS_Store deleted file mode 100644 index 5236b6119bcad9b2df1066ba9b42b396c29b1578..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}&BV5S|6p5@OPWCLTBON)W`~c&Ug7uh!^64YrnGL+uh;0BiuTP$lMy*nA^$Uh0hGjHQ6c)EWU)paXsI zAeiwc!#pw|&&~!P1`tAor}lY%5wvmCg%pyLNZk67@RcvXA!6lCiP};g5Cpd)Ts9 zjzpY#VchPkfG}vI%hg2~2V&R|gE&Z3tg9!iqE&3!YopO-y$;uAB#t|D`5CdD_J%;fhX*kJwLepI1+IOEfepF7a=h~3=jkJ%YeDD ztkV3xBE1S5Z-O0O({YT3Oz1(E!x`pQ@q4l4_=MvL8T_9XfVx|{+L54ijPdp)s54e(jM<=wxgreT2(F_pNX}UDfE@QYjpUsl zNgtkZLz4f`0G^%2`pjb?i@%)T5v*;!D^ZEe{rqG!Fz5X052A21uGQXnE^n=@7VLsu zvTxi6nYd$bJQ=mU;T1leOBwmu-19HOUeYbEAIo^`g>i4F0>YpNF4vb~9LS_CCvh-R zv94aQi*~VFu1u#pjYd`M?zd)DF>N*LRngo#n9Yjz#^(0nS@$vO$MRWI&*8gNvSu)Y z7nscRd2)wwB;$LqW&W8TAu&J<5ChA|fVu1J(lRDTIS~WIz^@p<`$2#rItEjX>gs?& zwE%z?n3cd>{rUq6GypmVQ;lE&;W`vhhjP;fl%j=@wTSU~7UK+!-0G4Q7hd;oxSRK)-Q diff --git a/buildSrc/src/main/.DS_Store b/buildSrc/src/main/.DS_Store deleted file mode 100644 index 4b3783d68af1d52d6e1a30832e44f4bcff4316ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}&BV5S|5u5@NzZ6ONmBB?^K+#7jjyc(q0kYLE)ihT0`ix(H zT}%jiGscjaWait>&a|Cxo81loh~~Ik1tzUJ}8JGgvIrvkK!10`$LO<{e@V6G8)*me)9)mFp4XccachG*0MP# z=M*>xD$^@&Cc+et}c`c{rR}#Uk1HNySQW*}-XC|DylW!MG)9G%lR+f7QjagYv8}({g*7px*v%IspwR3dd?uSp2deLtU0>4i! z>lWwmii3rkp1olds^|gz^PG7sBQwAZFaxW?fZgAm!m1R+bua_Wz^^et`-4O!bS)+Z z_11w#w*ZJ4bZfye{WemLwCGw)4B`xmFsXS5Z-O8O(;SS3OxqA7Hw_)DPCf%2d_r-pi+~zXfVx|CN+mr$XQ>=C-HT3 zW_Kf$>cxX#nSt4FGdr_kz70DW#u#^|gC=8D#+U($STJGuMsOW*%euz2{t+p7tZelR(3w5$V9Z4pT=W-%5VNS4C18Gc;|&;X>Gl1l#PmU z=RS(mO}u0pJKp35pDu+6{e15ESHUptRX0yXlz2fjoXCJ+Fa(#|>mVA4)DhEY5X)Fs zEf}U@_NuknY_HX-Tl5ud6e%-efEf5C19(4Jpoq4{Org9wV2~{U zU$djK6smB><(pw2{bsH^6s}tj zZb^5>ZG|)v1H`~01K9h4RI&b_{oMacCmM(WVqi5H;H9qHbs#rgTbHuLT5EycgQB2c nrtm8SCbATRFP7pOs1&eUI03XZW(vUqLO%kM1{#QgKV{$($AMDY diff --git a/buildSrc/src/main/kotlin/com/.DS_Store b/buildSrc/src/main/kotlin/com/.DS_Store deleted file mode 100644 index d421a8f7f04154fa3bd3c878ab37317928cb77f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOH0E*5T0$T-BN@e6nb3nTJTYy=pod4@M=U4Dz!01gE1>jA4nOeG~!$dn@>RFWK+mFPaavAduSLy2hxLB zUrt4{<2NcmYbPOv8@PuM-mPB{>j1~-!`MYze{uLMJ{YEVF8(RFi=(u+y! zQ5I!cp8MB&==a*ae%fevPwDDN>o}P7+re?v8MZ3(dpha0qomU{2~pU=kh7C03H7j{ z`$?FZT;C4Jk}S0<)zN6RUazV3&FyhbjkecTYHDp`YdkK=g~g?v!`4lFo9G98Z-l__ z)L_o>gdVXorNhAQCb3SgaBPw{iDza7SOHexFDu~oG+F-3li+t}1z3S^QGoUbg+}Z- z&Mcd)0~=EUAQ#YWfPMO9q#WhgbDUYm5rnX*$Tn5D5<}Q@^eY$VInFHGbP%ri5bnvs zRVczd9q+G9I0(-&x2ymw@KFJ({SXy8|M$PH|4k4#tN<(UKNS##rr&Jf+}znZHA^~c t71{+Ff#NdDZz(*+oqEIZ& z%+5J;PT9HiZ&ly#2HjrP2s-CSBGiz9f(V1gEpekV;-dV`}Q=7_<_3a|pKz;r5LcQdCvozv%8vjVKZ4=OU=vmAS;s}~BR767+w!{#Ij{VZ+c@}enh7Q6OAHqIa z*a}7Hr{n#lP6y!`dkwI5oA&i}*j>wlfZ4J*J3{7(f$sp&Tx_-^)W9eYbU vYbE*>IvM5V20thm=%W~O=_p=8*M|L)0z}VZZV-FW_(wp?zzr+#s|vgW2!2{u diff --git a/buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store b/buildSrc/src/main/kotlin/com/skydoves/bindables/.DS_Store deleted file mode 100644 index 545df4597073053020f1e91dc1a942817ba98d68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%TB{E5FA4fl{kYEWtK`60d$W_ArCkaLC5uH+qi zUyetL9{|$iu($>)0An^`QfEM99(0|QU}3TvD?H27-a3 zF~BohGCp$*9Sj5m!N3;-+8;8TurAm++SWm(>$ChLp@er?WP*J+Mg>*QrBczjq1XK>NsrIo+StXIx#db5s@CEu9z_ N0V5<-FmMD0J^%xzEZzVB From bf7874a7bcba0fa072e18132a893b380f0000c04 Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 18 Jun 2022 16:30:51 +0900 Subject: [PATCH 4/5] Update GitHub workflows --- .github/workflows/android.yml | 41 +++++++++++++------------- .github/workflows/publish-snapshot.yml | 34 +++++++++++++++++++++ .github/workflows/publish.yml | 31 +++++++++++++++++++ 3 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/publish-snapshot.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 943bac5..b237bb4 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] pull_request: - branches: [ '*' ] + branches: [ main ] jobs: lint: @@ -36,24 +36,25 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: set up JDK - uses: actions/setup-java@v1 - with: - java-version: 11 + - name: set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 - - name: Cache Gradle and wrapper - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Make Gradle executable - run: chmod +x ./gradlew - - - name: Build with Gradle - run: ./gradlew build \ No newline at end of file + - name: Cache Gradle and wrapper + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Make Gradle executable + run: chmod +x ./gradlew + + - name: Build with Gradle + run: ./gradlew build diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml new file mode 100644 index 0000000..75d6b46 --- /dev/null +++ b/.github/workflows/publish-snapshot.yml @@ -0,0 +1,34 @@ +name: Publish Snapshot builds + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + publish: + name: Snapshot build and publish + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 11 + - name: Release build + run: ./gradlew assemble --scan + - name: Source jar and dokka + run: ./gradlew androidSourcesJar javadocJar --scan + - name: Publish to MavenCentral + run: ./gradlew publishReleasePublicationToSonatypeRepository --scan + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + SNAPSHOT: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..96f97a1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish + +on: + release: + types: [released] + +jobs: + publish: + name: Release build and publish + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 11 + - name: Release build + run: ./gradlew assemble --scan + - name: Source jar and dokka + run: ./gradlew androidSourcesJar javadocJar --scan + - name: Publish to MavenCentral + run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository --scan + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} From f177fc38ce507e2444c1bf9127c60f38b9835e80 Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 18 Jun 2022 16:37:01 +0900 Subject: [PATCH 5/5] Update min sdk to 21 --- .../src/main/kotlin/com/skydoves/bindables/Configuration.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt b/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt index a75f404..cc51d40 100644 --- a/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt +++ b/buildSrc/src/main/kotlin/com/skydoves/bindables/Configuration.kt @@ -19,7 +19,7 @@ package com.skydoves.bindables object Configuration { const val compileSdk = 32 const val targetSdk = 32 - const val minSdk = 16 + const val minSdk = 21 const val majorVersion = 1 const val minorVersion = 1 const val patchVersion = 0