forked from ks3dev/ForceStopGB
-
Notifications
You must be signed in to change notification settings - Fork 5
/
custom_rules.xml
38 lines (34 loc) · 2.33 KB
/
custom_rules.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules">
<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
<classpath path="${ant.library.dir}"/>
</taskdef>
<target name="sonar" depends="-setup">
<pathconvert pathsep="," property="sonar.sources">
<fileset dir="${basedir}" includes="src/**/*.java"/>
</pathconvert>
<pathconvert pathsep="," property="sonar.libraries">
<fileset dir="${basedir}" includes="bin/classes" />
</pathconvert>
<property name="sonar.projectName" value="${ant.project.name}"/>
<property name="sonar.projectKey" value="${project.app.package}"/>
<xpath input="${manifest.abs.file}" expression="/manifest/@android:versionName" output="project.app.versionName" />
<property name="sonar.projectVersion" value="${project.app.versionName}"/>
<sonar:sonar xmlns:sonar="antlib:org.sonar.ant"/>
</target>
<target name="-pre-compile">
<!-- add *.jar to compilier library -->
<pathconvert property="bootstrap.class.path">
<fileset dir="lib" includes="*.jar" />
<path refid="project.target.class.path" />
</pathconvert>
<path id="project.target.class.path">
<pathelement path="${bootstrap.class.path}" />
</path>
<xpath input="${manifest.abs.file}" expression="/manifest/@android:versionName" output="project.app.versionName" />
<replaceregexp file="${gen.absolute.dir}/me/piebridge/forcestopgb/BuildConfig.java"
match="(.*boolean\s+DEBUG\s*=.*)"
replace='\1${line.separator} public static final boolean RELEASE = true;${line.separator} public static final String APPLICATION_ID = "${project.app.package}";${line.separator} public static final String VERSION_NAME = "${project.app.versionName}";${line.separator} public static final String ALIPAY_ACCOUNT = null;${line.separator} public static final boolean ALIPAY_DONATE = false;${line.separator} public static final String WECHAT_ACCOUNT = null;${line.separator} public static final boolean WECHAT_DONATE = false;${line.separator} public static final String PAYPAL_ACCOUNT = null;' />
</target>
<property name="java.compilerargs" value="-Xlint:unchecked -Xlint:deprecation"/>
</project>