|
1 |
| -/* |
2 |
| - * Catroid: An on-device visual programming system for Android devices |
3 |
| - * Copyright (C) 2010-2016 The Catrobat Team |
4 |
| - * (<http://developer.catrobat.org/credits>) |
5 |
| - * |
6 |
| - * This program is free software: you can redistribute it and/or modify |
7 |
| - * it under the terms of the GNU Affero General Public License as |
8 |
| - * published by the Free Software Foundation, either version 3 of the |
9 |
| - * License, or (at your option) any later version. |
10 |
| - * |
11 |
| - * An additional term exception under section 7 of the GNU Affero |
12 |
| - * General Public License, version 3, is available at |
13 |
| - * http://developer.catrobat.org/license_additional_term |
14 |
| - * |
15 |
| - * This program is distributed in the hope that it will be useful, |
16 |
| - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
| - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
| - * GNU Affero General Public License for more details. |
19 |
| - * |
20 |
| - * You should have received a copy of the GNU Affero General Public License |
21 |
| - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 |
| - */ |
| 1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. |
23 | 2 |
|
24 | 3 | buildscript {
|
25 | 4 | repositories {
|
| 5 | + mavenLocal() |
26 | 6 | mavenCentral()
|
27 | 7 | }
|
| 8 | + |
28 | 9 | dependencies {
|
29 | 10 | classpath 'com.android.tools.build:gradle:2.1.2'
|
| 11 | + // NOTE: Do not place your application dependencies here; they belong |
| 12 | + // in the individual module build.gradle files |
30 | 13 | }
|
31 | 14 | }
|
32 | 15 |
|
33 |
| -repositories { |
34 |
| - mavenCentral() |
35 |
| -} |
36 |
| - |
37 |
| -apply plugin: 'com.android.application' |
38 |
| -apply plugin: 'checkstyle' |
39 |
| -apply plugin: 'pmd' |
40 |
| -apply from: 'gradle/code_quality_tasks.gradle' |
41 |
| -apply from: 'gradle/intellij_config_tasks.gradle' |
42 |
| -apply from: 'gradle/standalone_apk_tasks.gradle' |
43 |
| - |
44 |
| -check.dependsOn 'checkstyle' |
45 |
| -check.dependsOn 'pmd' |
46 |
| - |
47 |
| -android { |
48 |
| - dexOptions { |
49 |
| - javaMaxHeapSize "4g" |
50 |
| - } |
51 |
| - buildTypes { |
52 |
| - debug { |
53 |
| - buildConfigField "boolean", "FEATURE_LEGO_NXT_ENABLED", "true" |
54 |
| - buildConfigField "boolean", "FEATURE_PHIRO_ENABLED", "true" |
55 |
| - buildConfigField "boolean", "FEATURE_PARROT_AR_DRONE_ENABLED", "true" |
56 |
| - buildConfigField "boolean", "FEATURE_USERBRICKS_ENABLED", "true" |
57 |
| - buildConfigField "boolean", "FEATURE_NFC_ENABLED", "true" |
58 |
| - buildConfigField "boolean", "FEATURE_ARDUINO_ENABLED", "true" |
59 |
| - buildConfigField "boolean", "FEATURE_RASPI_ENABLED", "true" |
60 |
| - buildConfigField "boolean", "FEATURE_POCKETMUSIC_ENABLED", "true" |
61 |
| - } |
62 |
| - release { |
63 |
| - buildConfigField "boolean", "FEATURE_LEGO_NXT_ENABLED", "true" |
64 |
| - buildConfigField "boolean", "FEATURE_PHIRO_ENABLED", "true" |
65 |
| - buildConfigField "boolean", "FEATURE_PARROT_AR_DRONE_ENABLED", "false" |
66 |
| - buildConfigField "boolean", "FEATURE_USERBRICKS_ENABLED", "false" |
67 |
| - buildConfigField "boolean", "FEATURE_ARDUINO_ENABLED", "true" |
68 |
| - buildConfigField "boolean", "FEATURE_RASPI_ENABLED", "true" |
69 |
| - buildConfigField "boolean", "FEATURE_NFC_ENABLED", "true" |
70 |
| - buildConfigField "boolean", "FEATURE_POCKETMUSIC_ENABLED", "false" |
71 |
| - } |
72 |
| - } |
73 |
| - productFlavors { |
74 |
| - catroid { |
75 |
| - applicationId 'org.catrobat.catroid' |
76 |
| - buildConfigField "String", "START_PROJECT", "\"No Starting Project\"" |
77 |
| - buildConfigField "String", "PROJECT_NAME", "\"No Standalone Project\"" |
78 |
| - buildConfigField "boolean", "FEATURE_APK_GENERATOR_ENABLED", "false" |
79 |
| - } |
80 |
| - |
81 |
| - standalone { |
82 |
| - applicationId 'org.catrobat.catroid.' + getPackageNameSuffix() |
83 |
| - versionCode 1 |
84 |
| - versionName '1.0' |
85 |
| - |
86 |
| - buildConfigField "String", "PROJECT_NAME", "\"${(String) getProjectName()}\""; |
87 |
| - buildConfigField "String", "START_PROJECT", "\"${(String) getProgramId(true) }\"" |
88 |
| - buildConfigField "boolean", "FEATURE_APK_GENERATOR_ENABLED", "true" |
89 |
| - } |
90 |
| - } |
91 |
| -} |
92 |
| - |
93 |
| -ext { |
94 |
| - projectVersion = "0.9" |
95 |
| -} |
96 |
| - |
97 |
| -configurations { |
98 |
| - compile.exclude group: 'xpp3' //compile problem with xstream |
99 |
| - natives |
100 |
| -} |
101 |
| - |
102 |
| -dependencies { |
103 |
| - compile 'com.google.guava:guava:18.0' |
104 |
| - compile 'com.squareup.okhttp:okhttp:2.3.0' |
105 |
| - compile 'com.google.code.gson:gson:2.4' |
106 |
| - compile 'com.github.johnpersano:supertoasts:1.3.4@aar' |
107 |
| - compile 'com.thoughtworks.xstream:xstream:1.4.7' |
108 |
| - def gdxVersion = '1.6.2' |
109 |
| - compile 'com.badlogicgames.gdx:gdx:' + gdxVersion |
110 |
| - compile 'com.badlogicgames.gdx:gdx-backend-android:' + gdxVersion |
111 |
| - natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-x86' |
112 |
| - natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-armeabi' |
113 |
| - natives 'com.badlogicgames.gdx:gdx-platform:' + gdxVersion + ':natives-armeabi-v7a' |
114 |
| - compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" |
115 |
| - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi" |
116 |
| - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a" |
117 |
| - natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86" |
118 |
| - compile 'com.facebook.android:facebook-android-sdk:4.6.0' |
119 |
| - compile 'com.android.support:support-v4:23.4.0' |
120 |
| - compile 'com.android.support:percent:23.4.0' |
121 |
| - compile 'com.google.android.gms:play-services-auth:9.0.0' |
122 |
| - compile 'com.android.support:multidex:1.0.1' |
123 |
| - compile fileTree(include: '*.jar', dir: 'catroid/libs') |
124 |
| - compile fileTree(include: '*.jar', dir: 'catroid/libs-natives') |
125 |
| - androidTestCompile fileTree(include: '*.jar', dir: 'catroidTest/libs') |
126 |
| - androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.2.1' |
127 |
| - androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' |
128 |
| - androidTestCompile 'org.mockito:mockito-core:1.10.19' |
129 |
| - pmd 'net.sourceforge.pmd:pmd:5.1.1' |
130 |
| - checkstyle 'com.puppycrawl.tools:checkstyle:6.7' |
131 |
| -} |
132 |
| - |
133 |
| -def getCurrentGitBranch() { |
134 |
| - try { |
135 |
| - return 'git rev-parse --abbrev-ref HEAD'.execute().text.trim() |
136 |
| - } catch (IOException exception) { |
137 |
| - throw new UnsupportedOperationException("Could not find git! Maybe it is not in \$PATH variable?", exception) |
138 |
| - } |
139 |
| -} |
140 |
| - |
141 |
| -android { |
142 |
| - compileSdkVersion 23 |
143 |
| - buildToolsVersion '23.0.3' |
144 |
| - defaultConfig { |
145 |
| - minSdkVersion 16 |
146 |
| - targetSdkVersion 22 |
147 |
| - applicationId 'org.catrobat.catroid' |
148 |
| - testApplicationId "org.catrobat.catroid.test" |
149 |
| - testInstrumentationRunner 'pl.polidea.instrumentation.PolideaInstrumentationTestRunner' |
150 |
| - versionCode 31 |
151 |
| - println "VersionCode is " + versionCode |
152 |
| - versionName "0.9.24" |
153 |
| - println "VersionName is " + versionName |
154 |
| - buildConfigField "String", "GIT_DESCRIBE", "\"${versionName}\"" |
155 |
| - buildConfigField "String", "GIT_CURRENT_BRANCH", "\"${getCurrentGitBranch()}\"" |
156 |
| - multiDexEnabled true |
157 |
| - } |
158 |
| - |
159 |
| - sourceSets { |
160 |
| - main { |
161 |
| - manifest.srcFile 'catroid/AndroidManifest.xml' |
162 |
| - java.srcDirs = ['catroid/src'] |
163 |
| - resources.srcDirs = ['catroid/src'] |
164 |
| - aidl.srcDirs = ['catroid/src'] |
165 |
| - renderscript.srcDirs = ['catroid/src'] |
166 |
| - res.srcDirs = ['catroid/res'] |
167 |
| - assets.srcDirs = ['catroid/assets'] |
168 |
| - jniLibs.srcDirs = ['catroid/jniLibs'] |
169 |
| - } |
170 |
| - |
171 |
| - androidTest { |
172 |
| - manifest.srcFile 'catroidTest/AndroidManifest.xml' |
173 |
| - java.srcDirs = ['catroidTest/src'] |
174 |
| - resources.srcDirs = ['catroidTest/src'] |
175 |
| - aidl.srcDirs = ['catroidTest/src'] |
176 |
| - renderscript.srcDirs = ['catroidTest/src'] |
177 |
| - res.srcDirs = ['catroidTest/res'] |
178 |
| - assets.srcDirs = ['catroidTest/assets'] |
179 |
| - } |
180 |
| - } |
181 |
| - lintOptions { |
182 |
| - // specific ignores should be defined via lint.xml file, all general ignores should be added here |
183 |
| - lintConfig file('config/lint.xml') |
184 |
| - // CommitPrefEdits should be reviewed, if using apply instead of commit is working with our tests |
185 |
| - // RtlSymmetry/RtlHardcoded should be reviewed |
186 |
| - // GradleDynamicVersion ignored - e.g. according to sdkmanager:gradle-plugin it should be imported this way |
187 |
| - // IconMissingDensityFolder - currently no xxxhdpi icons available |
188 |
| - // TODO ticket for HandlerLeak |
189 |
| - // TODO don't know if WrongRegion warning is a false-positive one |
190 |
| - ignore 'ContentDescription', 'InvalidPackage', 'ValidFragment', 'GradleDependency', |
191 |
| - 'ClickableViewAccessibility', 'UnusedAttribute', 'CommitPrefEdits', 'OldTargetApi', |
192 |
| - 'RtlSymmetry', 'GradleDynamicVersion', 'RtlHardcoded', 'HandlerLeak', 'IconMissingDensityFolder', |
193 |
| - 'WrongRegion', 'RelativeOverlap', 'IconColors', 'MissingTranslation', 'ExtraTranslation' |
194 |
| - |
195 |
| - textReport true |
196 |
| - xmlReport true |
197 |
| - htmlReport true |
198 |
| - xmlOutput file("build/reports/lint.xml") |
199 |
| - htmlOutput file("build/reports/lint.html") |
200 |
| - } |
201 |
| -} |
202 |
| - |
203 |
| -task copyAndroidNatives() { |
204 |
| - file("catroid/jniLibs/armeabi/").mkdirs(); |
205 |
| - file("catroid/jniLibs/armeabi-v7a/").mkdirs(); |
206 |
| - file("catroid/jniLibs/x86/").mkdirs(); |
207 |
| - configurations.natives.files.each { jar -> |
208 |
| - def outputDir = null |
209 |
| - if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("catroid/jniLibs/armeabi-v7a") |
210 |
| - if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("catroid/jniLibs/armeabi") |
211 |
| - if (jar.name.endsWith("natives-x86.jar")) outputDir = file("catroid/jniLibs/x86") |
212 |
| - if (outputDir != null) { |
213 |
| - copy { |
214 |
| - from zipTree(jar) |
215 |
| - into outputDir |
216 |
| - include "*.so" |
217 |
| - } |
218 |
| - } |
| 16 | +allprojects { |
| 17 | + repositories { |
| 18 | + mavenLocal() |
| 19 | + mavenCentral() |
219 | 20 | }
|
220 | 21 | }
|
0 commit comments