Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38 publish helper #39

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -48,3 +48,21 @@ Supported options are:

The DEX file parsing is based on the `dexdeps` tool from
[the Android source tree](https://android.googlesource.com/platform/dalvik.git/+/master/tools/dexdeps/).


# To prepare a release

## Update the version

Edit `gradle.properties` and set the new `pom.version` number.

## Set your credentials in `local.properties`

## Build and publish
Run the following
````
./gradlew install -Pprofile=javadoc,sources
./gradlew publishArtifacts
````

If successful, commit the version changes and tag. Then update the version number and commit.
42 changes: 40 additions & 2 deletions build.gradle
@@ -1,3 +1,16 @@
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
}

apply plugin: 'application'

mainClassName = "info.persistent.dex.Main"
Expand All @@ -12,9 +25,34 @@ sourceSets {
}

jar {
// Redirect output to match launcher script
destinationDir = file('build/jar')
manifest {
attributes("Main-Class": mainClassName)
}
}


task postTask() << {
description "Redirect output to match launcher script"
new File('build/jar/').mkdirs()
copy {
from 'build/libs/'
into 'build/jar/'
rename { filename ->
filename.replace("-"+project.property('pom.version'), "")
}
}
}

assemble.finalizedBy postTask


project.group = ( project.hasProperty('pom.groupId')
? project.property('pom.groupId') : "" )

project.version =
( project.hasProperty('pom.version') ? project.property('pom.version') : "1.0" )

apply from: 'https://raw.githubusercontent.com/chrisdoyle/gradle-fury/master/gradle/maven-support.gradle'
//optional if you want to store your password encrypted
//apply from: 'https://raw.githubusercontent.com/chrisdoyle/gradle-fury/master/gradle/encryption.gradle'

146 changes: 146 additions & 0 deletions gradle.properties
@@ -0,0 +1,146 @@
# Gradle build environment properties --------------------------------------------------------------

# From the Gradle documentation, "Chapter 20. The Build Environment":
#
# "Enables new incubating mode that makes Gradle selective when configuring projects. Only relevant
# projects are configured which results in faster builds for large multi-projects."
org.gradle.configureondemand true

# "Specifies the jvmargs used for the daemon process. The setting is particularly useful for
# tweaking memory settings. At the moment, the default settings are pretty generous with regards
# to memory."
org.gradle.jvmargs=-Xms256m -Xmx1024m -XX:MaxPermSize=256m


# Maven Repository (i.e. Sonatype Nexus Repository Manager) Configuration --------------------------

# the following can also be put in local.properties too. don't commit them
#NEXUS_USERNAME=
# the password can also be encrypted by the encryption plugin
#NEXUS_PASSWORD=

RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots/

# Java Configuration -------------------------------------------------------------------------------

compileJava.sourceCompatibility=1.7
compileJava.targetCompatibility=1.7



# Maven POM Configuration (used by maven-publish in gradle/maven-support.gradle) -------------------

description=Simple tool to output per-package method counts in an Android DEX executable grouped by package, to aid in getting under the 65,536 referenced method limit.

# NOTE: this is also used as the default project.version

# Fixme - update this before publishing to central
pom.version=1.0.0-SNAPSHOT

# NOTE: this is also used as the default project.group
pom.groupId=info.persistent

pom.url=https://github.com/mihaip/dex-method-counts
pom.inceptionYear=2014

pom.licenses.license.0.name=The Apache Software License, Version 2.0
pom.licenses.license.0.url=http://www.apache.org/licenses/
pom.licenses.license.0.distribution=repo

# Pro tip: don't use special symbols that interfere with XML parsing in any of the pom settings
# like any of the following ' " < >

pom.organization.name=info.persistent
pom.organization.url=https://github.com/mihaip/dex-method-counts

pom.issueManagement.system=GitHub
pom.issueManagement.url=https://github.com/mihaip/dex-method-counts/issues

#pom.ciManagement.system=Travis
#pom.ciManagement.url=https://travis-ci.org/chrisdoyle/gradle-fury

pom.scm.url=https://github.com/mihaip/dex-method-counts
pom.scm.connection=https://github.com/mihaip/dex-method-counts.git
pom.scm.developerConnection=https://github.com/mihaip/dex-method-counts.git

pom.distributionManagement.site.id=github
pom.distributionManagement.site.url=https://github.com/mihaip/dex-method-counts/releases

# developer list

pom.developers.developer.0.id=mihaip
pom.developers.developer.0.name=mihaip
pom.developers.developer.0.email=mihaip @ github
pom.developers.developer.0.organization=mihaip
pom.developers.developer.0.role.0=Project Owner




# new as of version 1.0.10 of gradle fury, javadoc generation with Graphviz and the UMLGraph doclet
# it's disabled by default, opt in setting. primarily because it adds a significant amount of time
# to the build when javadocs are enabled (gradlew instal -Pprofile=javadoc)

# it's also not available on MacOS since the build for graphviz crashes in some cases. On some projects
# it will fail to generate any javadocs at all, turn it off if you have problems

fury.javadocs.umlgraph.enabled=false

# new as of version 1.0.10 of gradle fury, the site plugin
# run it with gradlew site

# enables the "fork me" banner for github pages. pom.scm.url must be a github url
site.forkMe.enable=true
# this is the name of the site, top left banner
site.name=dex-method-counts






###### GPG Signature support #######
# this can also go in your local.properties file too
# you don't normally need this, unless you're really cool and publishing artifacts to the original
# (and best) repository, Maven Central. It will sign all artifacts when being published via the
# 'publishArtifacts' task

# Looks scary, but everything is optional, unless gpg isn't in your path

# Path to the gpg executable, default is unix default to /usr/local/bin/gpg
# mandatory for signing, you can use which gpg or where gpg depending on os, to locate the executable
# GPG_PATH=/absolute/path/to/gpg.exe

# optional
#signing.homeDir
#--homedir (value)

# optional use something other than the default key to sign
# you can use either keyId or keyname
#signing.keyId=24875D73
#signing.keyname=24875D73
#translates to --local-user (value)

# optional
#signing.isInteractive=true (default is true)
#translates to if (false) --no-tty

# optional
#signing.defaultKeyring=true (default is true)
#translates to if (false) --no-default-keyring

# optional, use a different key ring file that the default
#signing.publicKeyring
#translates to --keyring (value)

# optional - only needed when you have to specify the password via command line
# most OS's will prompt you for the password
#signing.passPhrase=secret
#you can also GPG_PASSPHRASE
#--batch

# optional, use a different key ring file that the default
#signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg
#translates to --secret-keyring (value)