Skip to content

Commit 771c433

Browse files
authored
Update build.gradle to allow gradle publishing (#7)
* Update build.gradle to allow gradle publishing * Add extra task to build.gradle necessary for the publishPlugins task * Update logic to use firely plugin already published * Update build.gradle to allow more easily local testing of changes to the firely-plugin module; Update Readme section * Update lib version to 0.2.1 * Comment debug code only
1 parent 2c80c8e commit 771c433

File tree

6 files changed

+56
-29
lines changed

6 files changed

+56
-29
lines changed

.circleci/config.yml

-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ jobs:
5858
<<: *android_config
5959
steps:
6060
- checkout
61-
- run-gradle-cmd:
62-
desc: Publish Plugin to MavenLocal
63-
cmd: "firely-plugin::publishToMavenLocal"
6461
- run-gradle-cmd:
6562
desc: Build Release
6663
cmd: "clean assembleRelease"

README.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -183,25 +183,28 @@ can track the configuration changes over time.
183183
184184
## Use in the project
185185
186-
You need to apply the plugin (TODO integrate in maven repo):
186+
You need to apply the plugin:
187187
188188
```
189-
buildscript {
190-
repositories {
191-
mavenLocal()
192-
}
193-
194-
dependencies {
195-
classpath group: 'com.busbud.android', name: 'firely-plugin', version: '0.2.0'
196-
}
189+
plugins {
190+
<... all your other plugins ...>
191+
id 'com.busbud.android.firely' version '0.2.0'
197192
}
198193
199-
apply plugin: 'com.busbud.android.firely'
200-
201194
```
202195
203196
You also need to import the aar (TODO integrate in maven repo):
204197
205198
`compile project(':firely-0.2.0')`
206199
207200
201+
## If you need to update the plugin on the Gradle Plugin Portal (ADMINS ONLY)
202+
203+
Currently this process is manual and it is not being done via CI.
204+
In order to do this you need to have access to this [account](https://plugins.gradle.org/u/android-busbud).
205+
206+
- Bump the version of library
207+
- Run the following command (keys are available on the account):
208+
```
209+
./gradlew publishPlugins -Pgradle.publish.key=<key> -Pgradle.publish.secret=<secret>
210+
```

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ buildscript {
2626
ext.buildtools_version = '33.0.0'
2727
ext.corektx_version = '1.7.0'
2828
ext.compilesdk_version = 32
29+
ext.lib_version = '0.2.1'
2930

3031
repositories {
3132
google()

firely-lib/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ publishing {
6868
firely(MavenPublication) {
6969
groupId 'com.busbud.android'
7070
artifactId 'firely'
71-
version '0.2.0'
71+
version "$lib_version"
7272
artifact(sourceJar)
7373
artifact("$buildDir/outputs/aar/firely-lib-release.aar")
7474
}

firely-plugin/build.gradle

+30-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919
*/
2020

21-
apply plugin: 'kotlin'
22-
apply plugin: 'maven-publish'
23-
apply plugin: 'kotlinx-serialization'
21+
plugins {
22+
id 'kotlin'
23+
id 'maven-publish'
24+
id 'kotlinx-serialization'
25+
id "com.gradle.plugin-publish" version "1.0.0"
26+
}
2427

2528
dependencies {
2629
repositories {
@@ -48,16 +51,39 @@ task sourcesJar(type: Jar, dependsOn: classes) {
4851
from sourceSets.main.allSource
4952
}
5053

54+
tasks.withType(Copy).all { duplicatesStrategy 'exclude' }
55+
5156
artifacts {
5257
archives sourcesJar
5358
}
5459

60+
version = "$lib_version"
61+
group = "com.busbud"
62+
63+
pluginBundle {
64+
website = 'https://github.com/busbud/firely'
65+
vcsUrl = 'https://github.com/busbud/firely'
66+
description = "Library to simplify the integration and management of A/B testing"
67+
tags = ['firely', 'remote_configs', 'firebase']
68+
}
69+
70+
71+
gradlePlugin {
72+
plugins {
73+
firelyPlugin {
74+
id = 'com.busbud.android.firely'
75+
implementationClass = 'com.busbud.android.firely.FirelyPlugin'
76+
displayName = "Firely Plugin"
77+
}
78+
}
79+
}
80+
5581
publishing {
5682
publications {
5783
main(MavenPublication) {
5884
groupId 'com.busbud.android'
5985
artifactId 'firely-plugin'
60-
version '0.2.0'
86+
version "$lib_version"
6187

6288
from components.java
6389
artifact sourcesJar

firely-sample/build.gradle

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
1818
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1919
*/
20-
21-
apply plugin: 'com.android.application'
22-
apply plugin: 'kotlin-android'
23-
apply plugin: 'com.busbud.android.firely'
24-
apply plugin: 'com.google.gms.google-services'
25-
2620
buildscript {
2721
repositories {
2822
google()
29-
mavenLocal()
3023
mavenCentral()
24+
// mavenLocal()
3125
}
26+
// dependencies {
27+
// classpath group: 'com.busbud.android', name: 'firely-plugin', version: "$lib_version"
28+
// }
29+
}
3230

33-
dependencies {
34-
classpath group: 'com.busbud.android', name: 'firely-plugin', version: '0.2.0'
35-
}
31+
plugins {
32+
id 'com.android.application'
33+
id 'kotlin-android'
34+
id 'com.google.gms.google-services'
35+
id "com.busbud.android.firely" version "0.2.1"
3636
}
3737

3838
android {

0 commit comments

Comments
 (0)