blob: bcdd2226ae38804b732b0c6d8f827b9418998d75 [file] [log] [blame]
apply plugin: 'sdk-files'
/***
DEPRECATED! DEPRECATED! DEPRECATED! DEPRECATED!
WARNING THIS FILE IS NO LONGER BEING USED AND WILL BE REMOVED IN THE NEAR FUTURE
INSTEAD MODIFY:
android/build/python/aemu/distribution.py
OR BETTER:
Modify the CMakeLists.txt such that the install(xxx) binplaces what you want
to have end up in the release
DEPRECATED! DEPRECATED! DEPRECATED! DEPRECATED!
**/
import com.android.tools.internal.emulator.BuildEmulator
// Get SDK revision to define emulator revision
File fprops = new File(rootDir.getParentFile(), 'external/qemu/source.properties')
Properties props = new Properties()
props.load(fprops.newDataInputStream())
// Mac/Win emulator now has dependency on haxm 6.2.1
File fprops_mac = new File(rootDir.getParentFile(), 'external/qemu/mac.source.properties')
File fprops_win = new File(rootDir.getParentFile(), 'external/qemu/win.source.properties')
task buildDefaultEmulator(type: BuildEmulator) {
revision = props."Pkg.Revision"
build_number = System.getenv("BUILD_NUMBER")
output = new File(project.buildDir, "default")
}
task buildEmulatorCodeCoverage(type: BuildEmulator) {
debug = true
revision = props."Pkg.Revision"
build_number = System.getenv("BUILD_NUMBER")
output = new File(project.buildDir, "coverage")
}
task buildWindowsEmulator(type: BuildEmulator) {
revision = props."Pkg.Revision"
build_number = System.getenv("BUILD_NUMBER")
output = new File(project.buildDir, "windows")
windows = true
}
// Package all data to construct a coverage report.
task packageCodeCoverage(type: Zip) {
dependsOn buildEmulatorCodeCoverage
outputs.upToDateWhen { false }
archiveName = "code-coverage.zip"
destinationDir = new File(project.buildDir, "coverage")
from(buildEmulatorCodeCoverage.output) {
include "**/*.csv"
}
from(buildEmulatorCodeCoverage.output) {
include "**/*.gcda"
}
from(buildEmulatorCodeCoverage.output) {
include "**/*.gcno"
}
}
sdk {
common(mac, linux) {
item("$buildDefaultEmulator.output/distribution/emulator") {
into ''
builtBy buildDefaultEmulator
}
item("$buildDefaultEmulator.output/build/debug_info/") {
into ''
builtBy buildDefaultEmulator
debug true
}
item("$project.rootDir/../external/qemu/android-info.txt") {
into ''
}
// This will make it end up in the Debug configuration.
item("$buildEmulatorCodeCoverage.output/code-coverage.zip") {
debug true
into ''
builtBy packageCodeCoverage
}
}
linux {
item(fprops) {
notice null
}
}
mac {
item(fprops_mac) {
name 'source.properties'
notice null
}
}
windows {
item("$buildWindowsEmulator.output/distribution/emulator") {
into ''
builtBy buildWindowsEmulator
}
item("$buildWindowsEmulator.output/build/debug_info/") {
into ''
builtBy buildWindowsEmulator
debug true
}
item("$project.rootDir/../external/qemu/android-info.txt") {
into ''
}
item(fprops_win) {
name 'source.properties'
notice null
}
item("$project.rootDir/../external/qemu/android-info.txt") {
into ''
}
}
}
import com.android.tools.internal.sdk.base.PlatformConfig
import com.android.tools.internal.sdk.base.ToolItem
import com.google.common.collect.Lists
for (PlatformConfig platform : sdk.getPlatforms()) {
def itemlist = Lists.newArrayList()
for (ToolItem toolitem: platform.getItems()) {
if (toolitem.getDebug() || !toolitem.getExecutable()) {
continue
}
def prop = toolitem.properties
def itemPath = prop.itemPath
if (itemPath instanceof String || itemPath instanceof GString) {
def debugItemPath = itemPath
def path = debugItemPath.split("/")
def s = path[path.size()-1]
if (!s.contains("emulator")) {
continue
}
debugItemPath = debugItemPath.replaceFirst("$buildDefaultEmulator.output",
"$buildDefaultEmulator.output/build/debug_info")
if (debugItemPath.equals(itemPath)) {
continue
}
if (platform.getName().equals("mac")) {
debugItemPath += ".dSYM"
if (!prop.destinationPath) {
path = debugItemPath.split("/")
prop.destinationPath = path[path.size()-1]
}
}
prop.debug=true;
prop.remove('itemPath')
prop.remove('class')
def propcopy = {
prop.each { k, v ->
delegate."$k"=v
}
return debugItemPath
}
def debugitem = new ToolItem(propcopy)
propcopy.delegate = debugitem
itemlist.add(debugitem)
}
}
for (ToolItem debugitem: itemlist) {
platform.getItems().add(debugitem)
}
}