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"
35 def add_icon_task( dir, scale ) {
36 return tasks.create( "createIcon-" + dir, Exec ) {
37 def outdir = new File( "res", "drawable-" + dir )
39 doFirst { outdir.mkdirs() }
40 def png = new File( outdir, "wine.png" )
41 def svg = new File( "@srcdir@", "wine.svg" )
44 commandLine "rsvg-convert", "-z", scale, "-o", png, svg
48 tasks.whenTaskAdded { t ->
49 if (t.name.equals( "generateDebugResources" )) {
50 t.dependsOn add_icon_task( "ldpi", 0.75 )
51 t.dependsOn add_icon_task( "mdpi", 1 )
52 t.dependsOn add_icon_task( "hdpi", 1.5 )
53 t.dependsOn add_icon_task( "xhdpi", 2 )
54 t.dependsOn add_icon_task( "xxhdpi", 3 )
55 t.dependsOn add_icon_task( "xxxhdpi", 4 )
62 buildToolsVersion "25.0.3"
66 applicationId "org.winehq.wine"
69 versionName "@PACKAGE_VERSION@"
70 setProperty( "archivesBaseName", "wine" )
75 main.assets.srcDirs = [ "assets" ]
76 main.java.srcDirs = [ "@srcdir@" ]
77 main.jniLibs.srcDirs = [ "lib" ]
78 main.java.excludes = [ "build" ]
79 main.res.srcDirs = [ "res" ]
80 main.manifest.srcFile "@srcdir@/AndroidManifest.xml"