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

Use Android Studio 3.2 #836

Merged
merged 4 commits into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ output.json
bin/
gen/
out/
jacoco.exec

# Gradle files
.gradle/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.google.gms:google-services:4.0.1'
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed May 02 11:29:45 PDT 2018
#Mon Oct 08 07:49:51 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public class OneCollectorChannelListener extends AbstractChannelListener {
*
* @param context context.
* @param channel channel.
* @param logSerializer log serializer.
* @param installId installId.
*/
public OneCollectorChannelListener(@NonNull Context context, @NonNull Channel channel, @NonNull LogSerializer logSerializer, @NonNull UUID installId) {
mChannel = channel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static void setName(CommonSchemaLog log, String name) throws IllegalArgum
*
* @param src source log.
* @param dest destination common schema log.
* @param transmissionTarget transmission target to use.
*/
public static void addPartAFromLog(Log src, CommonSchemaLog dest, String transmissionTarget) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ public static DatabaseStorage getDatabaseStorage(@NonNull String database,
* Set maximum SQLite database size.
*
* @param maxStorageSizeInBytes Maximum SQLite database size.
* @return true if database size was set, otherwise false.
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically not in scope of the PR but it's always good to leave the campground cleaner ;)

*/
public boolean setMaxStorageSize(long maxStorageSizeInBytes) {
return mDatabaseManager.setMaxSize(maxStorageSizeInBytes);
Expand Down
44 changes: 22 additions & 22 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ allprojects {
jacoco {
toolVersion '0.7.9'
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}

//noinspection GroovyAssignabilityCheck
group rootProject.ext.groupId
Expand Down Expand Up @@ -75,35 +78,27 @@ subprojects {

androidTestImplementation 'com.crittercism.dexmaker:dexmaker-dx:1.4'
androidTestImplementation 'com.crittercism.dexmaker:dexmaker-mockito:1.4'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation project(':test')
}

// Android Studio 2.2.0 broke a lot of scripting, could not find another way of doing this rename trick
def createDebugCoverageReportExecutionDataFile = file("${buildDir}/outputs/code-coverage/connected/coverage.ec")

task renameCreateDebugCoverageReportExecutionDataFile(dependsOn: 'createDebugCoverageReport') {
doLast {
def file = file(createDebugCoverageReportExecutionDataFile.getParentFile()).listFiles().first()
file.renameTo(createDebugCoverageReportExecutionDataFile)
}
}

task coverageReport(type: JacocoReport, dependsOn: ['renameCreateDebugCoverageReportExecutionDataFile', 'testDebugUnitTest']) {
task coverageReport(type: JacocoReport, dependsOn: ['createDebugCoverageReport', 'testDebugUnitTest']) {
reports {
xml.enabled = false
xml.enabled = true
html.enabled = true
}

def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*']
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = files(["${buildDir}/jacoco/testDebugUnitTest.exec",
createDebugCoverageReportExecutionDataFile])
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
sourceDirectories = files(["$projectDir/src/main/java"])
classDirectories = files([
fileTree(dir: "$buildDir/intermediates/classes/debug", excludes: fileFilter),
fileTree(dir: "$buildDir/intermediates/javac/debug/compileDebugJavaWithJavac/classes", excludes: fileFilter)
])
executionData = fileTree(dir: buildDir, includes: [
'jacoco/testDebugUnitTest.exec',
'outputs/code-coverage/connected/*coverage.ec'
])
}

task sourcesJar(type: Jar) {
Expand All @@ -120,6 +115,11 @@ subprojects {
configurations.api.dependencies.withType(ProjectDependency).dependencyProject.buildDir.each { dir -> classpath += files("${dir}/intermediates/classes/release") }
//noinspection GroovyAssignabilityCheck
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompile.classpath
}
}
javadoc.dependsOn project.assembleRelease
}
}
Expand Down