diff --git a/.gitignore b/.gitignore index 5986e2684..421045d79 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ out # mvn target secrets.xml -pom-local.xml # logging logback.xml diff --git a/build.gradle b/build.gradle index 62430f65a..7c450c724 100644 --- a/build.gradle +++ b/build.gradle @@ -22,6 +22,7 @@ if (!project.hasProperty("android")) { apply plugin: 'checkstyle' apply plugin: 'jacoco' apply plugin: 'me.champeau.jmh' + apply plugin: 'maven-publish' } else { apply plugin: 'com.android.library' } @@ -51,32 +52,6 @@ compileTestJava { targetCompatibility = '1.8' sourceCompatibility = '1.8' -tasks.register('installLocal') { - def lines = [] - new File('pom.xml').withReader { reader -> - reader.eachLine { - lines.add(it) - } - } - - def changedVersion = false - new File('pom-local.xml').withWriter { writer -> - lines.forEach { - if (it.trim().startsWith('') && !changedVersion) { - writer.write('local') - changedVersion = true - } else { - writer.write(it) - } - } - } - - exec { - executable 'mvn' - args '-f', 'pom-local.xml', '-Dgpg.skip', 'install' - } -} - if (!project.hasProperty("android")) { jar { // Be sure to update version in pom.xml to match @@ -130,6 +105,18 @@ if (!project.hasProperty("android")) { duplicateClassesStrategy = DuplicatesStrategy.WARN } + + publishing { + publications { + mavenJava(MavenPublication) { + groupId = 'org.getodk' + artifactId = 'javarosa' + version = 'local' + + from components.java + } + } + } } else { android { namespace 'com.example'