Skip to content

Instantly share code, notes, and snippets.

@JaKXz
Last active February 17, 2018 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save JaKXz/8550278 to your computer and use it in GitHub Desktop.
Save JaKXz/8550278 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<project name="My Project" default="help" xmlns:sonar="antlib:org.sonar.ant">
<!-- Define the SonarQube global properties (the most usual way is to pass these properties via the command line) -->
<property name="sonar.jdbc.url" value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8" />
<property name="sonar.jdbc.username" value="sonar" />
<property name="sonar.jdbc.password" value="sonar" />
<!-- Define the SonarQube project properties -->
<property name="sonar.projectKey" value="my-project" />
<property name="sonar.projectName" value="My Project" />
<property name="sonar.projectVersion" value="1.0" />
<property name="sonar.language" value="java" />
<property name="sonar.sources" value="src" />
<property name="sonar.binaries" value="bin/classes" />
<property name="sonar.tests" value="../My-Project-Test/src" />
<property name="sonar.profile" value="Android Lint" />
<property name="sonar.sourceEncoding" value="UTF-8" />
<!-- Define the SonarQube target -->
<target name="sonar" >
<taskdef resource="org/sonar/ant/antlib.xml" uri="antlib:org.sonar.ant" >
<classpath path="/usr/local/Cellar/ant/1.9.3/libexec/lib/sonar-ant-task-*.jar" />
</taskdef>
<!-- Execute the SonarQube analysis -->
<sonar:sonar />
</target>
<property file="local.properties" />
<property file="ant.properties" />
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<import file="custom_rules.xml" optional="true" />
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment