2 * Gradle build script for Wine
4 * Copyright 2017 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 apply plugin: 'com.android.application'
31 classpath "com.android.tools.build:gradle:2.2.1"
37 if (srcdir.equals(".")) { return "."; }
38 return (srcdir.charAt(0) == "/" ? srcdir : "../../" + srcdir) + "/dlls/wineandroid.drv";
41 def add_icon_task( dir, scale )
43 return tasks.create( "createIcon-" + dir, Exec ) {
44 def outdir = new File( "res", "drawable-" + dir )
46 doFirst { outdir.mkdirs() }
47 def png = new File( outdir, "wine.png" )
48 def svg = new File( get_srcdir(), "wine.svg" )
51 commandLine "rsvg-convert", "-z", scale, "-o", png, svg
57 return tasks.create( "checksumAssets", Exec ) {
58 commandLine "sh", "-c",
59 "(test -d assets && " +
60 "rm -f assets/files.sum assets/sums.sum && " +
61 "sha256sum \$(find assets -type f -print) | sed 's/ assets\\// /' >files.sum && " +
62 "sha256sum files.sum >sums.sum && " +
63 "mv files.sum sums.sum assets) || rm -rf assets";
69 if (name.equals( "generateDebugResources" ))
71 dependsOn add_icon_task( "ldpi", 0.75 )
72 dependsOn add_icon_task( "mdpi", 1 )
73 dependsOn add_icon_task( "hdpi", 1.5 )
74 dependsOn add_icon_task( "xhdpi", 2 )
75 dependsOn add_icon_task( "xxhdpi", 3 )
76 dependsOn add_icon_task( "xxxhdpi", 4 )
78 if (name.equals( "generateDebugAssets" ))
80 dependsOn checksum_task()
84 tasks.withType(JavaCompile)
86 options.compilerArgs << "-Xlint"
92 buildToolsVersion "25.0.3"
96 applicationId "org.winehq.wine"
99 versionName "@PACKAGE_VERSION@"
100 setProperty( "archivesBaseName", "wine" )
105 main.assets.srcDirs = [ "assets" ]
106 main.java.srcDirs = [ get_srcdir() ]
107 main.jniLibs.srcDirs = [ "lib" ]
108 main.java.excludes = [ "build" ]
109 main.res.srcDirs = [ "res" ]
110 main.manifest.srcFile get_srcdir() + "/AndroidManifest.xml"