// // Copyright (c) ZeroC, Inc. All rights reserved. // buildscript { repositories { google() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath 'com.android.tools.build:gradle:7.2.1' classpath 'gradle.plugin.com.zeroc.gradle.ice-builder:slice:1.5.0' } } apply plugin: 'com.android.application' apply plugin: 'com.zeroc.gradle.ice-builder.slice' slice { output = file("${project.buildDir}/generated/source/ice") cppConfiguration = project.cppConfiguration cppPlatform = project.cppPlatform if(!System.env.ICE_BIN_DIST?.split(" ").find{ it == 'all' || it.contains('java')}) { iceHome = project.hasProperty('iceHome') ? project.iceHome : System.getenv("ICE_HOME") != null ? System.env.ICE_HOME : new File("$rootProject.projectDir/../../../..").getCanonicalPath() } java { files = fileTree(dir: "$rootProject.projectDir/../../../../scripts/", includes: ['*.ice']) } } project.ext.srcDist = new File([project.slice.iceHome, "java", "src"].join(File.separator)).exists() repositories { if(this.devRepo) { maven { url this.devRepo } } if(project.ext.srcDist) { repositories { flatDir dirs: "file://${project.slice.iceHome}/java/lib" } } google() mavenCentral() } android { compileSdkVersion 30 defaultConfig { applicationId "com.zeroc.testcontroller" minSdkVersion 24 targetSdkVersion 30 multiDexEnabled true // Necessary otherwise we'd exceed the 64K DEX limit. compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } buildTypes { debug { // // Set minifyEnabled to false because the test app loads classes dynamically. // minifyEnabled false } release { // // Set minifyEnabled to false because the test app loads classes dynamically. // minifyEnabled false } } } task copyBksTask(type: Copy) { from "${rootProject.projectDir}/../../../../certs/client.bks" from "${rootProject.projectDir}/../../../../certs/server.bks" into "src/main/res/raw" } preBuild.dependsOn(copyBksTask) clean { delete("src/main/res/raw/client.bks") delete("src/main/res/raw/server.bks") } ext.localDependency = { artifactId -> def useBinDist = System.env.ICE_BIN_DIST?.split(" ").find{ it == 'all' || it.contains('java')} if(useBinDist) { return "com.zeroc:${artifactId}:${project.iceVersion}" } else { return ":${artifactId}-${project.iceVersion}" } } dependencies { implementation localDependency("glacier2") implementation localDependency("ice") implementation localDependency("icessl") runtimeOnly localDependency("icediscovery") runtimeOnly localDependency("icebt") implementation files("${rootProject.projectDir}/../../../lib/test.jar") runtimeOnly "org.apache.commons:commons-compress:1.14" }