winepulse: Set pulse master volume to 0 when session is muted.
[wine.git] / dlls / wineandroid.drv / build.gradle.in
blob662e8b7ea22f34126682b6a14ad09f76b0213920
1 /*
2  * Gradle build script for Wine
3  *
4  * Copyright 2017 Alexandre Julliard
5  *
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.
10  *
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.
15  *
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
19  */
21 apply plugin: 'com.android.application'
23 buildscript
25     repositories
26     {
27         jcenter()
28     }
29     dependencies
30     {
31         classpath "com.android.tools.build:gradle:2.2.1"
32     }
35 def get_srcdir()
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 )
45         outputs.dir( outdir )
46         doFirst { outdir.mkdirs() }
47         def png = new File( outdir, "wine.png" )
48         def svg = new File( get_srcdir(), "wine.svg" )
49         inputs.file( svg )
50         outputs.file( png )
51         commandLine "rsvg-convert", "-z", scale, "-o", png, svg
52     }
55 def checksum_task()
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";
64     }
67 tasks.whenTaskAdded
69     if (name.equals( "generateDebugResources" ))
70     {
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 )
77     }
78     if (name.equals( "generateDebugAssets" ))
79     {
80         dependsOn checksum_task()
81     }
84 tasks.withType(JavaCompile)
86     options.compilerArgs << "-Xlint"
89 android
91     compileSdkVersion 25
92     buildToolsVersion "25.0.3"
94     defaultConfig
95     {
96         applicationId "org.winehq.wine"
97         minSdkVersion 17
98         versionCode 1
99         versionName "@PACKAGE_VERSION@"
100         setProperty( "archivesBaseName", "wine" )
101     }
103     sourceSets
104     {
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"
111     }