Skip to content

Commit

Permalink
Add snapshot publishing (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturdm authored Apr 13, 2018
1 parent cbd9c72 commit b976c3c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cache:
directories:
- "$HOME/.gradle/caches/"
script:
- "./gradlew build jacocoTestReport"
- "./gradlew build jacocoTestReport publishSnapshot"
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ android {
}
}
```
Snapshots of the development version are available in [JFrog's `snapshots` repository][snapshots].

The above configuration will create a `JacocoReport` task for each variant and an additional `jacocoTestReport` task that runs all of them.
```
Expand Down Expand Up @@ -86,3 +87,5 @@ 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.
```

[snapshots]: https://oss.jfrog.org/artifactory/oss-snapshot-local/com/dicedmelon/gradle/jacoco-android
27 changes: 24 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'maven-publish'
id 'jacoco'
id 'pl.allegro.tech.build.axion-release' version '1.9.0'
id "com.jfrog.artifactory" version '4.7.1'
id 'com.jfrog.bintray' version '1.8.0'
}

Expand Down Expand Up @@ -66,10 +67,11 @@ publishing {
}
}

def credentials = (project.hasProperty('bintray.credentials') ?
project.property('bintray.credentials') :
System.getenv('BINTRAY_CREDENTIALS') ?: '').split(':')

bintray {
def credentials = (project.hasProperty('bintray.credentials') ?
project.property('bintray.credentials') : System.getenv('BINTRAY_CREDENTIALS') ?: '').split(
':')
user = credentials.first()
key = credentials.last()
publications = ['plugin']
Expand All @@ -84,3 +86,22 @@ bintray {
}
}
}

artifactory {
contextUrl = "http://oss.jfrog.org"
publish {
repository {
repoKey = "oss-snapshot-local"
username = credentials.first()
password = credentials.last()
}
defaults {
publications("plugin")
}
}
clientConfig.info.setBuildNumber(System.getProperty("build.number"))
}

task publishSnapshot() {
if (version.endsWith("-SNAPSHOT")) dependsOn artifactoryPublish
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9af7345c199f1731c187c96d3fe3d31f5405192a42046bafa71d846c3d9adacb
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionSha256Sum=98bd5fd2b30e070517e03c51cbb32beee3e2ee1a84003a5a5d748996d4b1b915
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b976c3c

Please sign in to comment.