|
| 1 | +// Just too many sub projects, so each can reference rootProject.version |
| 2 | +version = '0.9.16-RC3-SNAPSHOT' |
| 3 | + |
| 4 | +buildscript { |
| 5 | + repositories { |
| 6 | + jcenter() |
| 7 | + } |
| 8 | + dependencies { |
| 9 | + classpath 'com.android.tools.build:gradle:2.3.3' |
| 10 | + } |
| 11 | +} |
| 12 | + |
| 13 | +allprojects { |
| 14 | + repositories { |
| 15 | + jcenter() |
| 16 | + mavenCentral() |
| 17 | + mavenLocal() |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +if (JavaVersion.current().isJava8Compatible()) { |
| 22 | + allprojects { |
| 23 | + tasks.withType(Javadoc) { |
| 24 | + options.addStringOption('Xdoclint:none', '-quiet') |
| 25 | + } |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +def projectNamesToPublish = |
| 30 | + ['objectbox', |
| 31 | + 'objectbox-java-api', |
| 32 | + 'objectbox-java', |
| 33 | + 'objectbox-kotlin', |
| 34 | + 'objectbox-generator', |
| 35 | + 'objectbox-daocompat', |
| 36 | + 'linux', |
| 37 | + 'msbuild', |
| 38 | + ] |
| 39 | + |
| 40 | +configure(subprojects.findAll { projectNamesToPublish.contains(it.name) }) { |
| 41 | + apply plugin: 'maven' |
| 42 | + apply plugin: 'signing' |
| 43 | + |
| 44 | + configurations { |
| 45 | + deployerJars |
| 46 | + } |
| 47 | + |
| 48 | + dependencies { |
| 49 | + deployerJars 'org.apache.maven.wagon:wagon-webdav:1.0-beta-2' |
| 50 | + deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2' |
| 51 | + } |
| 52 | + |
| 53 | + signing { |
| 54 | + if (project.hasProperty('signing.keyId') && project.hasProperty('signing.password') && |
| 55 | + project.hasProperty('signing.secretKeyRingFile')) { |
| 56 | + sign configurations.archives |
| 57 | + } else { |
| 58 | + println "Signing information missing/incomplete for ${project.name}" |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | + // Use afterEvaluate or all dependencies will be lost in the generated POM |
| 63 | + afterEvaluate { |
| 64 | + uploadArchives { |
| 65 | + repositories { |
| 66 | + mavenDeployer { |
| 67 | + if (project.hasProperty('preferedRepo') && preferedRepo == 'local') { |
| 68 | + repository url: repositories.mavenLocal().url |
| 69 | + } else if (project.hasProperty('preferedRepo') && project.hasProperty('preferedUsername') |
| 70 | + && project.hasProperty('preferedPassword')) { |
| 71 | + configuration = configurations.deployerJars |
| 72 | + // Replace for bintray's dynamic URL |
| 73 | + preferedRepo = preferedRepo.replace('__groupId__', project.group) |
| 74 | + preferedRepo = preferedRepo.replace('__artifactId__', project.archivesBaseName) |
| 75 | + // println preferedRepo |
| 76 | + repository(url: preferedRepo) { |
| 77 | + authentication(userName: preferedUsername, password: preferedPassword) |
| 78 | + } |
| 79 | + } else if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) { |
| 80 | + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 81 | + def isSnapshot = version.endsWith('-SNAPSHOT') |
| 82 | + def sonatypeRepositoryUrl = isSnapshot ? |
| 83 | + "https://oss.sonatype.org/content/repositories/snapshots/" |
| 84 | + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" |
| 85 | + repository(url: sonatypeRepositoryUrl) { |
| 86 | + authentication(userName: sonatypeUsername, password: sonatypePassword) |
| 87 | + } |
| 88 | + } else { |
| 89 | + println "Settings sonatypeUsername/sonatypePassword missing/incomplete for ${project.name}" |
| 90 | + } |
| 91 | + |
| 92 | + pom.project { |
| 93 | + packaging 'jar' |
| 94 | + url 'http://objectbox.io' |
| 95 | + |
| 96 | + scm { |
| 97 | + url 'https://github.com/objectbox/objectbox-java' |
| 98 | + connection 'scm:git@github.com:objectbox/objectbox-java.git' |
| 99 | + developerConnection 'scm:git@github.com:objectbox/objectbox-java.git' |
| 100 | + } |
| 101 | + |
| 102 | + developers { |
| 103 | + developer { |
| 104 | + id 'ObjectBox' |
| 105 | + name 'ObjectBox' |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + issueManagement { |
| 110 | + system 'GitHub Issues' |
| 111 | + url 'https://github.com/objectbox/objectbox-java/issues' |
| 112 | + } |
| 113 | + |
| 114 | + organization { |
| 115 | + name 'ObjectBox Ltd.' |
| 116 | + url 'http://objectbox.io' |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + } |
| 122 | + } |
| 123 | +} |
| 124 | + |
| 125 | +task wrapper(type: Wrapper) { |
| 126 | + gradleVersion = '4.1' |
| 127 | + distributionType = org.gradle.api.tasks.wrapper.Wrapper.DistributionType.ALL |
| 128 | +} |
0 commit comments