forked from linkedin/dexmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publishing scripts and RELEASING.md file
Fixes linkedin#22 by properly configuring transitive dependencies in the published pom files.
- Loading branch information
Drew Hannay
committed
Dec 5, 2016
1 parent
e74716f
commit 7ed304c
Showing
8 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Releasing | ||
======== | ||
|
||
1. Change the version in `gradle.properties` to a non-SNAPSHOT version. | ||
2. Update the `CHANGELOG.md` for the impending release. | ||
3. Update the `README.md` with the new version. | ||
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version) | ||
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) | ||
6. `./gradlew clean artifactory distributeBuild` | ||
7. Update the `gradle.properties` to the next SNAPSHOT version. | ||
8. `git commit -am "Prepare next development version."` | ||
9. `git push && git push --tags` | ||
10. Create a new release in the releases tab on GitHub | ||
|
||
|
||
Prerequisites | ||
------------- | ||
|
||
Set the following environment variables: | ||
|
||
* `ARTIFACTORY_USER` - LinkedIn Artifactory username for releasing to `com.linkedin.dexmaker`. | ||
* `ARTIFACTORY_KEY` - LinkedIn Artifactory API key for releasing to `com.linkedin.dexmaker`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,41 @@ | ||
import com.linkedin.gradle.DistributeTask | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.2.2' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' | ||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4' | ||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0" | ||
} | ||
} | ||
|
||
apply plugin: 'com.jfrog.artifactory' | ||
apply plugin: 'maven-publish' | ||
|
||
allprojects { | ||
group = GROUP_ID | ||
} | ||
|
||
artifactoryPublish.skip = true | ||
artifactory { | ||
contextUrl = 'https://linkedin.jfrog.io/linkedin' | ||
publish { | ||
repoKey = 'dexmaker' | ||
username = System.getenv('ARTIFACTORY_USER') ?: "" | ||
password = System.getenv('ARTIFACTORY_KEY') ?: "" | ||
|
||
defaults { | ||
publications 'lib' | ||
} | ||
|
||
publishArtifacts = true | ||
} | ||
clientConfig.setIncludeEnvVars(false) | ||
} | ||
|
||
task distributeBuild(type: DistributeTask) { | ||
dependsOn ':artifactoryPublish', 'dexmaker:artifactoryPublish', 'dexmaker-mockito:artifactoryPublish' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
plugins { | ||
id 'groovy' | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
compile gradleApi() | ||
compile localGroovy() | ||
|
||
compile 'org.ajoberstar:gradle-git:1.2.0' | ||
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.2' | ||
compile('org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0') { | ||
exclude module: 'groovy-all' | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
buildSrc/src/main/groovy/com/linked/gradle/DistributeTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.linkedin.gradle | ||
|
||
import groovy.json.JsonBuilder | ||
import org.apache.http.client.fluent.Request | ||
import org.apache.http.entity.ContentType | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.tasks.TaskAction | ||
import org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention | ||
|
||
class DistributeTask extends DefaultTask { | ||
|
||
@TaskAction | ||
public void distributeBuild() { | ||
ArtifactoryPluginConvention convention = project.convention.plugins.artifactory | ||
def buildNumber = convention.clientConfig.info.buildNumber | ||
def buildName = convention.clientConfig.info.buildName | ||
def context = convention.clientConfig.publisher.contextUrl | ||
def password = convention.clientConfig.publisher.password | ||
|
||
def body = [ | ||
"publish" : "true", | ||
"overrideExistingFiles": "false", | ||
"async" : "true", | ||
"targetRepo" : "maven", | ||
"sourceRepos" : ["test-butler"], | ||
"dryRun" : "false" | ||
] | ||
|
||
def bodyString = new JsonBuilder(body).toString() | ||
|
||
def content = Request.Post("$context/api/build/distribute/$buildName/$buildNumber") | ||
.bodyString(bodyString, ContentType.APPLICATION_JSON) | ||
.addHeader("X-JFrog-Art-Api", password) | ||
.execute() | ||
.returnContent() | ||
|
||
logger.lifecycle("Distribute Response: {}", content.asString()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters