2017-05-30 12:59:15 +02:00
|
|
|
/*
|
|
|
|
* Gradle build script for Wine
|
|
|
|
*
|
|
|
|
* Copyright 2017 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
|
|
|
buildscript
|
|
|
|
{
|
|
|
|
repositories
|
|
|
|
{
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies
|
|
|
|
{
|
|
|
|
classpath "com.android.tools.build:gradle:2.2.1"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-12 11:40:00 +02:00
|
|
|
def get_srcdir()
|
|
|
|
{
|
|
|
|
if (srcdir.equals(".")) { return "."; }
|
|
|
|
return (srcdir.charAt(0) == "/" ? srcdir : "../../" + srcdir) + "/dlls/wineandroid.drv";
|
|
|
|
}
|
|
|
|
|
2018-12-03 16:16:27 +01:00
|
|
|
def add_icon_task( dir, scale )
|
|
|
|
{
|
2017-05-30 12:59:15 +02:00
|
|
|
return tasks.create( "createIcon-" + dir, Exec ) {
|
|
|
|
def outdir = new File( "res", "drawable-" + dir )
|
|
|
|
outputs.dir( outdir )
|
|
|
|
doFirst { outdir.mkdirs() }
|
|
|
|
def png = new File( outdir, "wine.png" )
|
2020-09-12 11:40:00 +02:00
|
|
|
def svg = new File( get_srcdir(), "wine.svg" )
|
2017-05-30 12:59:15 +02:00
|
|
|
inputs.file( svg )
|
|
|
|
outputs.file( png )
|
|
|
|
commandLine "rsvg-convert", "-z", scale, "-o", png, svg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-03 16:16:27 +01:00
|
|
|
def checksum_task()
|
|
|
|
{
|
|
|
|
return tasks.create( "checksumAssets", Exec ) {
|
|
|
|
commandLine "sh", "-c",
|
|
|
|
"(test -d assets && " +
|
|
|
|
"rm -f assets/files.sum assets/sums.sum && " +
|
|
|
|
"sha256sum \$(find assets -type f -print) | sed 's/ assets\\// /' >files.sum && " +
|
|
|
|
"sha256sum files.sum >sums.sum && " +
|
|
|
|
"mv files.sum sums.sum assets) || rm -rf assets";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.whenTaskAdded
|
|
|
|
{
|
|
|
|
if (name.equals( "generateDebugResources" ))
|
|
|
|
{
|
|
|
|
dependsOn add_icon_task( "ldpi", 0.75 )
|
|
|
|
dependsOn add_icon_task( "mdpi", 1 )
|
|
|
|
dependsOn add_icon_task( "hdpi", 1.5 )
|
|
|
|
dependsOn add_icon_task( "xhdpi", 2 )
|
|
|
|
dependsOn add_icon_task( "xxhdpi", 3 )
|
|
|
|
dependsOn add_icon_task( "xxxhdpi", 4 )
|
|
|
|
}
|
|
|
|
if (name.equals( "generateDebugAssets" ))
|
|
|
|
{
|
|
|
|
dependsOn checksum_task()
|
|
|
|
}
|
2017-05-30 12:59:15 +02:00
|
|
|
}
|
|
|
|
|
2018-11-26 16:41:33 +01:00
|
|
|
tasks.withType(JavaCompile)
|
|
|
|
{
|
|
|
|
options.compilerArgs << "-Xlint"
|
|
|
|
}
|
|
|
|
|
2017-05-30 12:59:15 +02:00
|
|
|
android
|
|
|
|
{
|
2018-11-26 16:11:44 +01:00
|
|
|
compileSdkVersion 25
|
2017-05-30 12:59:15 +02:00
|
|
|
buildToolsVersion "25.0.3"
|
|
|
|
|
|
|
|
defaultConfig
|
|
|
|
{
|
|
|
|
applicationId "org.winehq.wine"
|
|
|
|
minSdkVersion 17
|
|
|
|
versionCode 1
|
|
|
|
versionName "@PACKAGE_VERSION@"
|
|
|
|
setProperty( "archivesBaseName", "wine" )
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets
|
|
|
|
{
|
|
|
|
main.assets.srcDirs = [ "assets" ]
|
2020-09-12 11:40:00 +02:00
|
|
|
main.java.srcDirs = [ get_srcdir() ]
|
2017-06-26 15:13:35 +02:00
|
|
|
main.jniLibs.srcDirs = [ "lib" ]
|
2017-05-30 12:59:15 +02:00
|
|
|
main.java.excludes = [ "build" ]
|
|
|
|
main.res.srcDirs = [ "res" ]
|
2020-09-12 11:40:00 +02:00
|
|
|
main.manifest.srcFile get_srcdir() + "/AndroidManifest.xml"
|
2017-05-30 12:59:15 +02:00
|
|
|
}
|
|
|
|
}
|