Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Android Gradle 3 #33

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
GRADLE_VERSION:
- 2.14.1
- 3.5
- 4.0-rc-2
- 4.1

exclude:
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
plugins {
id "com.gradle.plugin-publish" version "0.9.6"
// Eat your own dog food :)
id "org.sonarqube" version "2.3"
id "org.sonarqube" version "2.5"
id "com.jfrog.artifactory" version "4.4.4"
id "com.github.hierynomus.license" version "0.13.1"
id "net.researchgate.release" version "2.4.1"
Expand Down Expand Up @@ -40,6 +40,9 @@ repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url "https://maven.google.com"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@Shusshu Shusshu Oct 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, it depends which version of gradle you use. So this can be changed in a future PR.

Gradle 4.0 doesn't know about google() but would still be able to build everything...

}
maven {
url "https://repox.sonarsource.com/sonarsource"
}
Expand All @@ -48,7 +51,7 @@ repositories {
dependencies {
compile gradleApi()
compile 'org.sonarsource.scanner.api:sonar-scanner-api:2.9.0.887'
compileOnly 'com.android.tools.build:gradle:2.3.1'
compileOnly 'com.android.tools.build:gradle:3.0.0-rc1'
testCompile localGroovy()
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6 changes: 3 additions & 3 deletions integrationTests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

<properties>
<!-- Default version when running ITs on dev machines. Value overriden on cix.sh and .cix.yml -->
<gradle.version>3.5</gradle.version>
<androidBuildTools.version>25.0.3</androidBuildTools.version>
<androidGradle.version>2.3.2</androidGradle.version>
<gradle.version>4.1</gradle.version>
<androidBuildTools.version>26.0.1</androidBuildTools.version>
<androidGradle.version>3.0.0-rc1</androidGradle.version>
</properties>

<build>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/sonarqube/gradle/AndroidUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ private static void populateSonarQubeProps(Map<String, Object> properties, List<

Set<File> libraries = new LinkedHashSet<>();
libraries.addAll(bootClassPath);
// I don't know what is best: ApkVariant::getCompileLibraries() or BaseVariant::getJavaCompile()::getClasspath()
// I don't know what is best: ApkVariant::getCompileClasspath() or BaseVariant::getJavaCompile()::getClasspath()
// In doubt I put both in a set to remove duplicates
if (variant instanceof ApkVariant) {
libraries.addAll(((ApkVariant) variant).getCompileLibraries());
libraries.addAll(((ApkVariant) variant).getCompileClasspath(null).getFiles());
}
if (javaCompiler != null) {
libraries.addAll(javaCompiler.getClasspath().filter(File::exists).getFiles());
Expand Down