Files
ElderlyDialer/gradle/screenmatch.gradle
T

23 lines
1.2 KiB
Groovy

// Independent build-time utility; deliberately not attached to preBuild/assemble.
def screenMatchConfig = providers.gradleProperty('screenMatchConfig')
.getOrElse('tools/screenmatch/screenmatch.properties')
tasks.register('screenMatch', Exec) {
group = 'screen match'
description = 'Manually regenerate dimension resources from values/dimens.xml.'
workingDir rootDir
commandLine new File(System.getProperty('java.home'), 'bin/java').absolutePath,
'-Dfile.encoding=UTF-8', file('tools/screenmatch/ScreenMatch.java').absolutePath,
rootDir.absolutePath, file(screenMatchConfig).absolutePath
}
tasks.register('screenMatchPreview', Exec) {
group = 'screen match'
description = 'Generate a preview under build/screenmatch-preview without changing app resources.'
workingDir rootDir
commandLine new File(System.getProperty('java.home'), 'bin/java').absolutePath,
'-Dfile.encoding=UTF-8', file('tools/screenmatch/ScreenMatch.java').absolutePath,
rootDir.absolutePath, file(screenMatchConfig).absolutePath,
layout.buildDirectory.dir('screenmatch-preview/res').get().asFile.absolutePath
}