Skip to content

Commit

Permalink
Merge pull request #836 from Microsoft/feature/update-to-as32
Browse files Browse the repository at this point in the history
Use Android Studio 3.2
  • Loading branch information
guperrot committed Oct 9, 2018
2 parents d443691 + d8e6165 commit 4668ad6
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 25 deletions.
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.
*/
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

0 comments on commit 4668ad6

Please sign in to comment.