|
| 1 | +buildscript { |
| 2 | + repositories { |
| 3 | + google() |
| 4 | + jcenter() |
| 5 | + } |
| 6 | + dependencies { |
| 7 | + classpath 'com.android.tools.build:gradle:4.0.0' |
| 8 | + |
| 9 | + // NOTE: Do not place your application dependencies here; they belong |
| 10 | + // in the individual module build.gradle files |
| 11 | + } |
| 12 | +} |
| 13 | + |
| 14 | +//import com.google.common.io.Files |
| 15 | +//import com.google.common.base.Charsets |
| 16 | +// |
| 17 | +//task('checkJavaVersion') << { |
| 18 | +// def jvmVersion = System.getProperty('java.version') |
| 19 | +// def requiredVersion = System.getenv('JAVA_FOR_TESTS') ?: '1.8' |
| 20 | +// if (!jvmVersion.startsWith(requiredVersion)) { |
| 21 | +// throw new RuntimeException("Tools need to be compiled with Java $requiredVersion, you are using Java $jvmVersion.") |
| 22 | +// } |
| 23 | +//} |
| 24 | +//final def checkJavaVersionTask = tasks['checkJavaVersion'] |
| 25 | + |
| 26 | +ext.version = '1.1.2' |
| 27 | + |
| 28 | +/* |
| 29 | + * With the build server you are given two env variables. |
| 30 | + * The OUT_DIR is a temporary directory you can use to put things during the build. |
| 31 | + * The DIST_DIR is where you want to save things from the build. |
| 32 | + * |
| 33 | + * The build server will copy the contents of DIST_DIR to somewhere and make it available. |
| 34 | + */ |
| 35 | +if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) { |
| 36 | + ext.androidHostOut = file(System.env.OUT_DIR) |
| 37 | + ext.androidHostDist = file(System.env.DIST_DIR) |
| 38 | + ext.buildNumber = System.env.BUILD |
| 39 | +} else { |
| 40 | + // ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/ |
| 41 | + ext.androidHostOut = file("$rootDir/../../out") |
| 42 | + ext.androidHostDist = new File(ext.androidHostOut, "dist") |
| 43 | + ext.buildNumber = null |
| 44 | +} |
| 45 | + |
| 46 | +// rootProject.buildDir is specific to this gradle build. |
| 47 | +buildDir = new File(ext.androidHostOut, "build/root") |
| 48 | +ext.supportRepoOut = new File(buildDir, 'repo') |
| 49 | + |
| 50 | +ext.localRepo = project.hasProperty('localRepo') ? localRepo : "$ext.androidHostOut/repo" |
| 51 | + |
| 52 | +//// basic task for custom distribution of project via the build server. |
| 53 | +//task dist << { |
| 54 | +//} |
| 55 | + |
| 56 | +project(':constraintlayout') { |
| 57 | + ext.pomName = 'Android ConstraintLayout' |
| 58 | + ext.pomDesc = 'ConstraintLayout for Android' |
| 59 | +} |
| 60 | + |
| 61 | +project(':solver') { |
| 62 | + ext.pomName = 'Android ConstraintLayout Solver' |
| 63 | + ext.pomDesc = 'Solver for ConstraintLayout' |
| 64 | +} |
| 65 | + |
| 66 | +//subprojects { Project project -> |
| 67 | +// // Change buildDir first so that all plugins pick up the new value. |
| 68 | +// project.buildDir = project.file("$project.parent.buildDir/../$project.name/build") |
| 69 | +// |
| 70 | +// group = 'com.android.support.constraint' |
| 71 | +// version = rootProject.ext.version |
| 72 | +// |
| 73 | +// apply plugin: 'maven' |
| 74 | +// |
| 75 | +// repositories { |
| 76 | +// maven { url "$rootProject.projectDir/../../prebuilts/tools/common/m2/repository" } |
| 77 | +// } |
| 78 | +// |
| 79 | +// task release(type: Upload) { |
| 80 | +// configuration = configurations.archives |
| 81 | +// repositories { |
| 82 | +// mavenDeployer { |
| 83 | +// repository(url: uri("$rootProject.ext.supportRepoOut")) |
| 84 | +// if (project.getName() == 'constraintlayout' || project.getName() == 'solver') { |
| 85 | +// pom.project { |
| 86 | +// name project.ext.pomName |
| 87 | +// description project.ext.pomDesc |
| 88 | +// |
| 89 | +// url 'http://tools.android.com' |
| 90 | +// inceptionYear '2007' |
| 91 | +// |
| 92 | +// licenses { |
| 93 | +// license { |
| 94 | +// name 'The Apache Software License, Version 2.0' |
| 95 | +// url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 96 | +// distribution 'repo' |
| 97 | +// } |
| 98 | +// } |
| 99 | +// |
| 100 | +// scm { |
| 101 | +// url 'https://android.googlesource.com/platform/tools/sherpa' |
| 102 | +// connection 'git://android.googlesource.com/platform/tools/sherpa.git' |
| 103 | +// } |
| 104 | +// developers { |
| 105 | +// developer { |
| 106 | +// name 'The Android Open Source Project' |
| 107 | +// } |
| 108 | +// } |
| 109 | +// } |
| 110 | +// } |
| 111 | +// } |
| 112 | +// } |
| 113 | +// } |
| 114 | +// |
| 115 | +// def versionDir = { |
| 116 | +// def groupDir = new File(rootProject.ext.supportRepoOut, project.group.replace('.','/')) |
| 117 | +// def artifactDir = new File(groupDir, archivesBaseName) |
| 118 | +// return new File(artifactDir, version) |
| 119 | +// } |
| 120 | +// |
| 121 | +// def deployer = release.repositories.mavenDeployer |
| 122 | +// task generateSourceProps(dependsOn: release) << { |
| 123 | +// def content = "Maven.GroupId=$deployer.pom.groupId\n" + |
| 124 | +// "Maven.ArtifactId=$deployer.pom.artifactId\n" + |
| 125 | +// "Maven.Version=$deployer.pom.version\n" + |
| 126 | +// "Pkg.Desc=$project.ext.pomDesc $deployer.pom.version\n" + |
| 127 | +// "Pkg.Revision=1\n" + |
| 128 | +// "Extra.VendorId=android\n" + |
| 129 | +// "Extra.VendorDisplay=Android\n" + |
| 130 | +// "Maven.Dependencies=" + |
| 131 | +// String.join(",", project.configurations.compile.allDependencies.collect { |
| 132 | +// def p = parent.findProject(it.name) |
| 133 | +// return p ? "$p.group:$p.archivesBaseName:$p.version" : null |
| 134 | +// }.grep()) + |
| 135 | +// "\n" |
| 136 | +// Files.write(content, new File(versionDir(), 'source.properties'), Charsets.UTF_8) |
| 137 | +// } |
| 138 | +// |
| 139 | +// task createSeparateZip(type: Zip, dependsOn: generateSourceProps) { |
| 140 | +// into archivesBaseName |
| 141 | +// destinationDir project.parent.ext.androidHostDist |
| 142 | +// baseName = project.group |
| 143 | +// version = rootProject.ext.buildNumber |
| 144 | +// } |
| 145 | +// project.parent.dist.dependsOn createSeparateZip |
| 146 | +// createSeparateZip.dependsOn release |
| 147 | +// |
| 148 | +// project.afterEvaluate { |
| 149 | +// // The archivesBaseName isn't available intially, so set it now |
| 150 | +// def createZipTask = project.tasks.getByName("createSeparateZip") |
| 151 | +// createZipTask.appendix = archivesBaseName |
| 152 | +// createZipTask.from versionDir() |
| 153 | +// } |
| 154 | +//} |
0 commit comments