Skip to content

Commit 543d252

Browse files
authored
Merge pull request #1 from RedMadRobot/feature/bintray-publish
Bintray publish
2 parents fc04853 + ecf9aa0 commit 543d252

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed

Diff for: README.md

+30-8
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,52 @@ Small plugins to reduce boilerplate in Gradle build scripts.
2626

2727
## Installation
2828

29-
Add rpository to `settings.gradle`:
29+
Add repositories to `settings.gradle.kts`:
3030
```kotlin
3131
pluginManagement {
3232
repositories {
3333
google()
3434
gradlePluginPortal()
35-
36-
// If you want to use SNAPSHOTs
37-
maven {
38-
name = "GitHubPackages"
39-
setUrl("https://maven.pkg.github.com/RedMadRobot/gradle-infrastructure")
40-
credentials(PasswordCredentials::class)
41-
}
35+
maven(url = "https://dl.bintray.com/redmadrobot-opensource/android")
4236
}
4337
}
4438
```
4539

4640
Then you can apply any of plugins where you need:
4741
```kotlin
4842
plugins {
43+
id("redmadrobot.kotlin-library") version "0.2"
44+
id("redmadrobot.publish") version "0.2"
4945
id("redmadrobot.detekt") version "0.2"
5046
}
5147
```
5248

49+
<details>
50+
<summary>Alternatively you can specify plugin resolution strategy and set infrastructure version there</summary>
51+
52+
```kotlin
53+
// settings.gradle.kts
54+
pluginManagement {
55+
//...
56+
57+
resolutionStrategy {
58+
eachPlugin {
59+
if (requested.id.namespace == "redmadrobot") {
60+
useModule("com.redmadrobot.build:infrastructure:0.2")
61+
}
62+
}
63+
}
64+
}
65+
66+
// build.gradle.kts
67+
plugins {
68+
id("redmadrobot.kotlin-library")
69+
id("redmadrobot.publish")
70+
id("redmadrobot.detekt")
71+
}
72+
```
73+
</details>
74+
5375
## Plugins
5476

5577
### kotlin-library

Diff for: build.gradle.kts

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ plugins {
44
}
55

66
group = "com.redmadrobot.build"
7-
version = "0.2-SNAPSHOT"
7+
description = "Small plugins to reduce boilerplate in Gradle build scripts."
8+
version = "0.2"
89

910
kotlinDslPluginOptions {
1011
experimentalWarning.set(false)
@@ -56,12 +57,21 @@ java {
5657
withSourcesJar()
5758
}
5859

60+
val publishToBintray = "bintrayUsername" in properties && "bintrayPassword" in properties
61+
val isSnapshot = version.toString().endsWith("-SNAPSHOT")
5962
publishing {
6063
repositories {
6164
maven {
6265
name = "GitHubPackages"
6366
setUrl("https://maven.pkg.github.com/RedMadRobot/gradle-infrastructure")
6467
credentials(PasswordCredentials::class)
6568
}
69+
if (publishToBintray && !isSnapshot) {
70+
maven {
71+
name = "bintray"
72+
setUrl("https://api.bintray.com/maven/redmadrobot-opensource/android/infrastructure/")
73+
credentials(PasswordCredentials::class)
74+
}
75+
}
6676
}
6777
}

0 commit comments

Comments
 (0)