Skip to content

Changes made for compatibility with android gradle plugin 2.3.0 and Gradle 3.3, with Scala updated to 2.11.8. #92

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
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
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ See also sample projects at https://github.com/saturday06/gradle-android-scala-p

| Scala | Gradle | Android Plugin | compileSdkVersion | buildToolsVersion |
| ------ | ------ | ------------------- | ----------------- | ----------------- |
| 2.11.8 | 3.4.1 | 2.3.3 | 26 | 26.0.2 |
| 2.11.7 | 2.2.1 | 1.1.3, 1.2.3, 1.3.1 | 21, 22, 23 | 21.1.2, 22.0.1 |
| 2.10.5 | 2.2.1 | 1.1.3, 1.2.3, 1.3.1 | 21, 22, 23 | 21.1.2, 22.0.1 |

Expand All @@ -40,9 +41,13 @@ please try [android-scala-plugin-1.3.2](https://github.com/saturday06/gradle-and
`build.gradle`
```groovy
buildscript {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.xingda920813:gradle-android-scala-plugin:android-gradle-2.3.0'
}
}
```
Expand All @@ -62,7 +67,7 @@ The plugin decides scala language version using scala-library's version.
`build.gradle`
```groovy
dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
}
```

Expand Down Expand Up @@ -144,7 +149,7 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
}
```
Expand Down Expand Up @@ -173,7 +178,7 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }
}
Expand Down Expand Up @@ -256,12 +261,12 @@ http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.scala.ScalaCompileOp
```groovy
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}

dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.xingda920813:gradle-android-scala-plugin:android-gradle-2.3.0'
}
}

Expand All @@ -273,11 +278,11 @@ apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

android {
compileSdkVersion "android-22"
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
targetSdkVersion 22
targetSdkVersion 26
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -310,7 +315,7 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }
}
Expand All @@ -322,6 +327,7 @@ tasks.withType(ScalaCompile) {
```

## Changelog
- 1.6 Support android plugin 2.3.3 and Gradle 3.4.1
- 1.4 Support android plugin 1.1.3. Manual configuration for dex task is now unnecessary (contributed by [sgrif](https://github.com/sgrif))
- 1.3.2 Fix unexpected annotation processor's warnings
- 1.3.1 Support android plugin 0.12.2
Expand Down
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,30 @@ apply plugin: "signing"
apply plugin: "idea"

repositories {
jcenter()
mavenCentral()
}

buildscript {
repositories {
jcenter()
mavenCentral()
}
}

dependencies {
compile gradleApi()
compile localGroovy()
compile "commons-io:commons-io:2.4"
testCompile "com.android.tools.build:gradle:2.0.0"
testCompile "org.scala-lang:scala-compiler:2.11.7"
compile "commons-io:commons-io:2.5"
testCompile "com.android.tools.build:gradle:2.3.3"
testCompile "org.scala-lang:scala-compiler:2.11.8"
}

description "Gradle Android Scala Plugin adds scala language support to official gradle android plugin."
group = "jp.leafytree.gradle"
version = "1.5-SNAPSHOT"
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
group = "com.github.xingda920813"
version = "1.6-SNAPSHOT"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

def uploadToSonatypeRepository = hasProperty("sonatypeUserName")

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
apply plugin: "groovy"

repositories {
jcenter()
mavenCentral()
}

dependencies {
compile gradleApi()
compile localGroovy()
compile "com.google.guava:guava:17.0"
compile "com.google.guava:guava:21.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public class AndroidScalaPluginIntegrationTestTask extends DefaultTask {
].each { projectName, runOnTravis ->
def gradleArgs = ["clean", "connectedCheck", "uninstallAll"]
[
["2.2.1", true, "2.11.7", "1.3.1", "android-22", "22.0.1", "8", "23"],
["2.2.1", false, "2.10.5", "1.3.1", "android-22", "22.0.1", "8", "23"],
["2.2.1", false, "2.11.7", "1.3.1", "android-22", "22.0.1", "21", "23"],
["2.2.1", false, "2.10.5", "1.3.1", "android-22", "22.0.1", "21", "23"],
["3.3", true, "2.11.8", "2.3.3", "android-26", "26.0.2", "8", "23"],
["3.3", false, "2.11.8", "2.3.3", "android-26", "26.0.2", "8", "23"],
["3.3", false, "2.11.8", "2.3.3", "android-26", "26.0.2", "21", "23"],
["3.3", false, "2.11.8", "2.3.3", "android-26", "26.0.2", "21", "23"],
].each { testParameters ->
if (!travis || (runOnTravis && testParameters[1])) {
def gradleVersion = testParameters[0]
Expand All @@ -58,7 +58,7 @@ public class AndroidScalaPluginIntegrationTestTask extends DefaultTask {
distributionPath: "wrapper/dists",
zipStoreBase: "GRADLE_USER_HOME",
zipStorePath: "wrapper/dists",
distributionUrl: "http://services.gradle.org/distributions/gradle-" + gradleVersion + "-bin.zip",
distributionUrl: "http://services.gradle.org/distributions/gradle-" + gradleVersion + "-all.zip",
])
gradleWrapperProperties
}
Expand All @@ -73,7 +73,7 @@ public class AndroidScalaPluginIntegrationTestTask extends DefaultTask {
snaphotRepositoryUrl: snaphotRepositoryUrl,
scalaLibraryVersion: scalaLibraryVersion,
scalaDependencyVersion: scalaLibraryVersion.split("\\.").take(2).join("."),
androidScalaPluginVersion: "1.5-SNAPSHOT",
androidScalaPluginVersion: "1.6-SNAPSHOT",
androidPluginVersion: androidPluginVersion,
androidPluginCompileSdkVersion: androidPluginCompileSdkVersion,
androidPluginBuildToolsVersion: androidPluginBuildToolsVersion,
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-2.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk8
15 changes: 8 additions & 7 deletions sample/hello/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
classpath "com.android.tools.build:gradle:2.3.3"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.6"
}
}

Expand All @@ -17,8 +18,8 @@ apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

android {
compileSdkVersion "android-22"
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
targetSdkVersion 22
Expand Down Expand Up @@ -50,12 +51,12 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }

// to break 64k limit
compile "org.scalaz:scalaz-core_2.11:7.1.0"
compile "org.scalaz:scalaz-core_2.11:7.2.8"
compile "com.google.guava:guava-jdk5:17.0"
compile "org.apache.commons:commons-math3:3.3"
compile "org.apache.commons:commons-math3:3.6.1"
}
2 changes: 1 addition & 1 deletion sample/hello/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=http\://services.gradle.org/distributions/gradle-2.12-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-3.4.1-all.zip
10 changes: 5 additions & 5 deletions sample/libproject/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

android {
compileSdkVersion "android-22"
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
targetSdkVersion 22
Expand All @@ -30,14 +30,14 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
compile project(":lib1")
androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }

// to break 64k limit
compile "org.scalaz:scalaz-core_2.11:7.1.0"
compile "org.scalaz:scalaz-core_2.11:7.2.8"
compile "com.google.guava:guava-jdk5:17.0"
compile "org.apache.commons:commons-math3:3.3"
compile "org.apache.commons:commons-math3:3.6.1"
}

5 changes: 3 additions & 2 deletions sample/libproject/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
classpath "com.android.tools.build:gradle:2.3.3"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.6"
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/libproject/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=http\://services.gradle.org/distributions/gradle-2.12-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-3.4.1-all.zip
6 changes: 3 additions & 3 deletions sample/libproject/lib1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apply plugin: "com.android.library"
apply plugin: "jp.leafytree.android-scala"

android {
compileSdkVersion "android-22"
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 8
Expand All @@ -15,7 +15,7 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }
}
11 changes: 6 additions & 5 deletions sample/simple/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:1.3.1"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.4"
classpath "com.android.tools.build:gradle:2.3.3"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:1.6"
}
}

Expand All @@ -17,8 +18,8 @@ apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

android {
compileSdkVersion "android-22"
buildToolsVersion "22.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
targetSdkVersion 22
Expand All @@ -44,6 +45,6 @@ android {
}

dependencies {
compile "org.scala-lang:scala-library:2.11.7"
compile "org.scala-lang:scala-library:2.11.8"
compile "com.android.support:multidex:1.0.1"
}
2 changes: 1 addition & 1 deletion sample/simple/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=http\://services.gradle.org/distributions/gradle-2.12-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-3.4.1-all.zip
1 change: 1 addition & 0 deletions src/integTest/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url snaphotRepositoryUrl
Expand Down
1 change: 1 addition & 0 deletions src/integTest/appAndLib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url snaphotRepositoryUrl
Expand Down
5 changes: 3 additions & 2 deletions src/integTest/apt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url snaphotRepositoryUrl
Expand All @@ -9,7 +10,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:$androidPluginVersion"
classpath "jp.leafytree.gradle:gradle-android-scala-plugin:$androidScalaPluginVersion"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.6'
}
}

Expand Down Expand Up @@ -49,7 +50,7 @@ apt {
}
}

def AAVersion = "3.2"
def AAVersion = "3.3.2"

dependencies {
apt "org.androidannotations:androidannotations:$AAVersion"
Expand Down
Loading