gradle-android-scala-plugin adds scala language support to official gradle android plugin

Overview

gradle-android-scala-plugin

gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at https://github.com/saturday06/gradle-android-scala-plugin/tree/master/sample

Table of Contents generated with DocToc

Supported versions

Scala Gradle Android Plugin compileSdkVersion buildToolsVersion
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

If you want to use older build environment, please try android-scala-plugin-1.3.2

Installation

1. Add buildscript's dependency

build.gradle

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

2. Apply plugin

build.gradle

apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

3. Add scala-library dependency

The plugin decides scala language version using scala-library's version.

build.gradle

dependencies {
    compile "org.scala-lang:scala-library:2.11.7"
}

4. Put scala source files

Default locations are src/main/scala, src/androidTest/scala. You can customize those directories similar to java.

build.gradle

android {
    sourceSets {
        main {
            scala {
                srcDir "path/to/main/scala" // default: "src/main/scala"
            }
        }

        androidTest {
            scala {
                srcDir "path/to/androidTest/scala" // default: "src/androidTest/scala"
            }
        }
    }
}

5. Implement a workaround for DEX 64K Methods Limit

The Scala Application generally suffers DEX 64K Methods Limit. To avoid it we need to implement one of following workarounds.

5.1. Option 1: Use ProGuard

If your project doesn't need to run androidTest, You can use proguard to reduce methods.

Sample proguard configuration here:

proguard-rules.txt

-dontoptimize
-dontobfuscate
-dontpreverify
-dontwarn scala.**
-ignorewarnings
# temporary workaround; see Scala issue SI-5397
-keep class scala.collection.SeqLike {
    public protected *;
}

From: hello-scaloid-gradle

5.2. Option 2: Use MultiDex

Android comes with built in support for MultiDex. You will need to use MultiDexApplication from the support library, or modify your Application subclass in order to support versions of Android prior to 5.0. You may still wish to use ProGuard for your production build.

Using MultiDex with Scala is no different than with a normal Java application. See the Android Documentation and MultiDex author's Documentation for details.

It is recommended that you set your minSdkVersion to 21 or later for development, as this enables an incremental multidex algorithm to be used, which is significantly faster.

build.gradle

repositories {
    jcenter()
}

android {
    defaultConfig {
        multiDexEnabled true
    }
}

dependencies {
    compile "org.scala-lang:scala-library:2.11.7"
    compile "com.android.support:multidex:1.0.1"
}

Change application class.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="jp.leafytree.sample">
    <application android:name="android.support.multidex.MultiDexApplication">
</manifest>

If you use customized application class, please read next section.

To test MultiDexApplication, custom instrumentation test runner should be used. See also https://github.com/casidiablo/multidex/blob/publishing/instrumentation/src/com/android/test/runner/MultiDexTestRunner.java

build.gradle

android {
    defaultConfig {
        testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
    }
}

dependencies {
    compile "org.scala-lang:scala-library:2.11.7"
    compile "com.android.support:multidex:1.0.1"
    androidTestCompile "com.android.support:multidex-instrumentation:1.0.1", { exclude module: "multidex" }
}
5.2.1. Setup application class if you use customized one

Since application class is executed before multidex configuration, Writing custom application class has stll many pitfalls.

The application class must extend MultiDexApplication or override Application#attachBaseContext like following.

MyCustomApplication.scala

package my.custom.application

import android.app.Application
import android.content.Context
import android.support.multidex.MultiDex

object MyCustomApplication {
  var globalVariable: Int = _
}

class MyCustomApplication extends Application {
  override protected def attachBaseContext(base: Context) = {
    super.attachBaseContext(base)
    MultiDex.install(this)
  }
}

You need to remember:

NOTE: The following cautions must be taken only on your android Application class, you don't need to apply this cautions in all classes of your app

  • The static fields in your application class will be loaded before the MultiDex#installbe called! So the suggestion is to avoid static fields with types that can be placed out of main classes.dex file.
  • The methods of your application class may not have access to other classes that are loaded after your application class. As workaround for this, you can create another class (any class, in the example above, I use Runnable) and execute the method content inside it. Example:
  override def onCreate = {
    super.onCreate

    val context = this
    new Runnable {
      override def run = {
        variable = new ClassNeededToBeListed(context, new ClassNotNeededToBeListed)
        MyCustomApplication.globalVariable = 100
      }
    }.run
  }

This section is copyed from README.md for multidex project

Configuration

You can configure scala compiler options as follows:

build.gradle

tasks.withType(ScalaCompile) {
    // If you want to use scala compile daemon
    scalaCompileOptions.useCompileDaemon = true
    // Suppress deprecation warnings
    scalaCompileOptions.deprecation = false
    // Additional parameters
    scalaCompileOptions.additionalParameters = ["-feature"]
}

Complete list is described in http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.scala.ScalaCompileOptions.html

Complete example of build.gradle with manually configured MultiDexApplication

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }

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

repositories {
    jcenter()
}

apply plugin: "com.android.application"
apply plugin: "jp.leafytree.android-scala"

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

    defaultConfig {
        targetSdkVersion 22
        testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    productFlavors {
        dev {
            minSdkVersion 21 // To reduce compilation time
        }

        prod {
            minSdkVersion 8
        }
    }

    sourceSets {
        main {
            scala {
                srcDir "path/to/main/scala" // default: "src/main/scala"
            }
        }

        androidTest {
            scala {
                srcDir "path/to/androidTest/scala" // default: "src/androidTest/scala"
            }
        }
    }
}

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

tasks.withType(ScalaCompile) {
    scalaCompileOptions.deprecation = false
    scalaCompileOptions.additionalParameters = ["-feature"]
}

Changelog

  • 1.4 Support android plugin 1.1.3. Manual configuration for dex task is now unnecessary (contributed by sgrif)
  • 1.3.2 Fix unexpected annotation processor's warnings
  • 1.3.1 Support android plugin 0.12.2
  • 1.3 Incremental compilation support in scala 2.11
  • 1.2.1 Fix binary compatibility with JDK6
  • 1.2 Incremental compilation support in scala 2.10 / Flavors support
  • 1.1 MultiDexApplication support
  • 1.0 First release
Comments
  • Support incremental compilation

    Support incremental compilation

    Whenever I launch "gradle compileDebugScala", it seems to recompile everything. I know it, because I see the same warnings again.

    This isn't efficient.

    enhancement 
    opened by DavidPerezIngeniero 11
  • The plugin cannot find my scala

    The plugin cannot find my scala

    My environment is Windows 7 64bit, scala 2.11. I have update my build.gradle file as indicated in the README file. When I run gradlew --debu I got the following error. Looks like it cannot find my scala. I tried to set the CLASSPATH environment variable, but doesn't help.

    15:38:18.492 [ERROR] [org.gradle.BuildExceptionReporter]
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter]
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter] A problem occurred configuring project ':app'.
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter] > groovy.lang.MissingMethodException: No signature of method: java.net.URLClassLoader.close() is applicable for argument types: () values: []
    Possible solutions: use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), collect(), collect(groovy.lang.Closure), collect(java.util.Collection, groovy.lang.Closure)
    15:38:18.493 [ERROR] [org.gradle.BuildExceptionReporter]
    15:38:18.494 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:493)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:80)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31)
    15:38:18.500 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142)
    15:38:18.501 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    15:38:18.501 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    15:38:18.501 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    15:38:18.501 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    15:38:18.501 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    15:38:18.502 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.Main.doAction(Main.java:46)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.Main.main(Main.java:37)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
    15:38:18.503 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: java.net.URLClassLoader.close() is applicable for argument types: () values: []
    Possible solutions: use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), collect(), collect(groovy.lang.Closure), collect(java.util.Collection, groovy.lang.Closure)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
    15:38:18.504 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        ... 29 more
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: groovy.lang.MissingMethodException: No signature of method: java.net.URLClassLoader.close() is applicable for argument types: () values: []
    Possible solutions: use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), collect(), collect(groovy.lang.Closure), collect(java.util.Collection, groovy.lang.Closure)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        at jp.leafytree.gradle.AndroidScalaPlugin.scalaVersionFromClasspath(AndroidScalaPlugin.groovy:269)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        at jp.leafytree.gradle.AndroidScalaPlugin$scalaVersionFromClasspath.callStatic(Unknown Source)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        at jp.leafytree.gradle.AndroidScalaPlugin.addAndroidScalaCompileTask(AndroidScalaPlugin.groovy:313)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        at jp.leafytree.gradle.AndroidScalaPlugin$_apply_closure1_closure17.doCall(AndroidScalaPlugin.groovy:88)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        at jp.leafytree.gradle.AndroidScalaPlugin$_apply_closure1.doCall(AndroidScalaPlugin.groovy:87)
    15:38:18.505 [ERROR] [org.gradle.BuildExceptionReporter]        ... 36 more
    15:38:18.508 [ERROR] [org.gradle.BuildExceptionReporter]
    15:38:18.508 [LIFECYCLE] [org.gradle.BuildResultLogger]
    15:38:18.509 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
    
    bug 
    opened by davidshen84 9
  • Multidexing not working

    Multidexing not working

    I just cloned your sample, and put there many different libraries. Unfortunately it seems that multidex is not working because I get an error java.lang.ClassNotFoundException on path: DexPathList.

    Everything works fine unless I exceed 65k methods in included libraries.

    bug 
    opened by KamilLelonek 7
  • Error:Cause: scala/util/Properties$ : Unsupported major.minor version 52.0

    Error:Cause: scala/util/Properties$ : Unsupported major.minor version 52.0

    My project used to build before, now (all of the sudden) it fails with:

    Error:Cause: scala/util/Properties$ : Unsupported major.minor version 52.0

    I couldn't get any info on this error, the only thing I discovered that it is caused by this line in build.gradle:

    apply plugin: 'jp.leafytree.android-scala'

    More info here: http://stackoverflow.com/questions/31492714/building-android-app-with-scala-bad-class-file-magic/31494910#31494910

    Might that be due to some scala class being compiled to java 8? If yes, what can I do? I tried everything, including removing android studio, caches, sbt, gradle, scala jars, libraries, anything named "scala" etc.

    Some more info from log:

    Caused by: java.lang.UnsupportedClassVersionError: scala/util/Properties$ : Unsupported major.minor version 52.0 at java_lang_ClassLoader$loadClass.call(Unknown Source) at jp.leafytree.gradle.AndroidScalaPlugin.scalaVersionFromClasspath(AndroidScalaPlugin.groovy:132) at jp.leafytree.gradle.AndroidScalaPlugin$scalaVersionFromClasspath$0.callStatic(Unknown Source) at jp.leafytree.gradle.AndroidScalaPlugin.addAndroidScalaCompileTask(AndroidScalaPlugin.groovy:184) at jp.leafytree.gradle.AndroidScalaPlugin$_apply_closure4_closure18.doCall(AndroidScalaPlugin.groovy:84) at jp.leafytree.gradle.AndroidScalaPlugin$_apply_closure4.doCall(AndroidScalaPlugin.groovy:83) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)

    opened by ssuukk 5
  • Improve Build Times?

    Improve Build Times?

    Is there currently any way to use any of the methods to improve build time that other scala android libraries use? For instance installing the Scala library on a development device, and not including the scala library with debug builds so that it doesn't have to be compiled into the android APK?

    opened by ScottPierce 5
  • Scala Library project

    Scala Library project

    I have an Android library project, which is used by another Android Scala project. I have added in the dependencies of the app, the custom lib. When compiling, no Scala code is compiled. I know because the folder MyLib/build/classes is empty except for the BuildConfig.class.

    buildscript {
        repositories {
            mavenCentral()
            maven {
                url "http://saturday06.github.io/gradle-android-scala-plugin/repository/snapshot"
            }
        }
        dependencies {
            // 0.8.3 con Gradle 1.10
            classpath 'com.android.tools.build:gradle:0.10.4'
            // https://github.com/saturday06/gradle-android-scala-plugin
            classpath 'jp.leafytree.gradle:gradle-android-scala-plugin:1.0-SNAPSHOT'
        }
    }
    
    apply plugin: 'idea'
    apply plugin: 'android-scala'
    android {
        scala {
             addparams '-feature -target:jvm-1.7'
        }
        sourceSets {
            main {
                scala {
                    srcDir "src/main/scala"
                }
            }
        }
    }
    

    My code is in MyLib/src/main/scala. I consider this a bug in the plugin.

    In a Scala Android app, the Scala code is compiled, but fails because of the absence of the compiled classes from my lib.

    bug 
    opened by DavidPerezIngeniero 5
  • Could not resolve all dependencies for configuration

    Could not resolve all dependencies for configuration

    Hi! Can me help with problem?

    Could not resolve all dependencies for configuration ':app:_x1DebugCompile'. Could not find org.scala-lang:scala-library:2.11.6. Searched in the following locations: file:/home/alexander/sdk/android/extras/android/m2repository/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.pom file:/home/alexander/sdk/android/extras/android/m2repository/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar file:/home/alexander/sdk/android/extras/google/m2repository/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.pom file:/home/alexander/sdk/android/extras/google/m2repository/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar

    I make project with command "gradle build"

    opened by ulx 4
  • Unable to compile in Android Studio 1.1.0

    Unable to compile in Android Studio 1.1.0

    This line throws an error resulting in the following message:

    Error:No such property: bootClasspath for class: com.android.build.gradle.AppPlugin
    

    This line breaks starting with Android Gradle Plugin version 1.1.0. Here's how the Groovy Android Plugin works around it: 1, 2, 3.

    bug 
    opened by dead-claudia 4
  • Cannot import to IntelliJ 14

    Cannot import to IntelliJ 14

    I cannot import the sample/simple project to the fresh IntelliJ14CE.

    Screenshot: https://www.dropbox.com/s/knhfidvnwfdebtp/Screen%20Shot%202015-01-17%20at%2000.37.44.png?dl=0 Log: https://www.dropbox.com/s/qrqg7qmvh4tbyi9/idea.log?dl=0

    Is there any ideas?

    opened by tseglevskiy 4
  • Stability when

    Stability when

    I've read this in the documentation:

    Since it's still unstable and under development, please don't use it in production app.
    

    I'm using it, and it works quite well. What are the known problems? Will it take long in order to consider it as stable?.

    opened by DavidPerezIngeniero 4
  • Could not find property 'allJava' on source set android test.

    Could not find property 'allJava' on source set android test.

    Hi,

    I am experiencing a weird issue with

    ./gradlew build --debug

    in android studio 0.6 (http://tools.android.com/recent/androidstudio060released)


    Gradle 1.12

    Build time: 2014-04-29 09:24:31 UTC Build number: none Revision: a831fa866d46cbee94e61a09af15f9dd95987421

    Groovy: 1.8.6 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 Ivy: 2.2.0 JVM: 1.7.0_21 (Oracle Corporation 23.21-b01) OS: Mac OS X 10.10 x86_64

    19:07:39.215 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: groovy.lang.MissingPropertyException: Could not find property 'allJava' on source set android test.
    19:07:39.216 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
    19:07:39.216 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
    19:07:39.217 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:94)
    19:07:39.218 [ERROR] [org.gradle.BuildExceptionReporter]    at com.android.build.gradle.internal.api.DefaultAndroidSourceSet_Decorated.getProperty(Unknown Source)
    19:07:39.219 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin$_updateAndroidSourceSetsExtension_closure13.doCall(AndroidScalaPlugin.groovy:302)
    19:07:39.220 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin.updateAndroidSourceSetsExtension(AndroidScalaPlugin.groovy:295)
    19:07:39.221 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin.apply(AndroidScalaPlugin.groovy:80)
    19:07:39.221 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin$apply.callCurrent(Unknown Source)
    19:07:39.222 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin.apply(AndroidScalaPlugin.groovy:119)
    19:07:39.223 [ERROR] [org.gradle.BuildExceptionReporter]    at jp.leafytree.gradle.AndroidScalaPlugin.apply(AndroidScalaPlugin.groovy)
    19:07:39.224 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
    19:07:39.225 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
    19:07:39.225 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
    19:07:39.226 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:116)
    19:07:39.226 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:36)
    19:07:39.227 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:85)
    19:07:39.228 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:129)
    19:07:39.229 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:41)
    19:07:39.230 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.Project$apply.call(Unknown Source)
    
    bug 
    opened by avaranovich 4
  • :compileDebugScala: R class not available to scala compiler

    :compileDebugScala: R class not available to scala compiler

    I'm using version 3.3.1 of the plugin fork by @AllBus (https://github.com/AllBus/gradle-android-scala-plugin), which doesn't have its own issue tracker.

    Apparently, the R.java file gets generated prior to the build, but is not considered by the scala compiler because it's stored in build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r:

    src/AprsService.scala:147: not found: value R
                                            getString(R.string.service_once)
    

    My workaround is to symlink the R.java file into the source dir, but as there are different paths for debug and release builds, I'm going to end up in hell for that.

    opened by ge0rg 0
  • Changes made for compatibility with android gradle plugin 2.3.0 and Gradle 3.3, with Scala updated to 2.11.8.

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

    Hi, saturday06.

    I have made some changes to gradle-android-scala-plugin, for Gradle 3.0+ deleted useAnt option, which is deprecated in Gradle 2.x. Continue to use useAnt will prevent Gradle to compile, so I removed it and updated Gradle to 3.3.

    I also updated Android Gradle Plugin to 2.3.0. From 2.2.0, it seems new version of the plugin only exists in jcenter, not in mavenCentral any more. So I changed the preferable repo to jcenter to retrieve new version of plugin.

    Scala has been updated to 2.11.8, with some other dependencies updated.

    I have run integTest on my local env and passed all the tests.

    opened by xingda920813 1
  • Please upload version 1.5 to jcenter and update README.md

    Please upload version 1.5 to jcenter and update README.md

    Version 1.5 is needed to support new android gradle plugin versions, but now, version 1.5 must be compiled from sources, which is inconvenience to use.

    Please upload version 1.5 to jcenter and update README.md about the description of supported android gradle plugin versions and the usage.

    Thank you!

    opened by xingda920813 1
  • Sample projects does not work at all

    Sample projects does not work at all

    I have git cloned your repo to my disk. Opened it in my Android Studio 2.0 and have some problems with building sample projects. Errors are:

    • Error:Gradle version 2.2 is required. Current version is 2.12. If using the gradle wrapper, try editing the distributionUrl in /Users/user/Documents/gradle-android-scala-plugin/sample/hello/gradle/wrapper/gradle-wrapper.properties to gradle-2.2-all.zip.

    then some workaround helped me to fix that. But I faced with this error:

    • Error:(17, 0) Could not find matching constructor for: org.gradle.api.internal.tasks.DefaultScalaSourceSet(java.lang.String, org.gradle.api.internal.file.BaseDirFileResolver)
    opened by lovesuper 3
  • retrolambda support

    retrolambda support

    Hi! We use retrolambda in our android project. I try to add gradle-android-scala-plugin (i use branch android-1.5.0). There are gradle build error in scala compiler:

    Compiling 1 Scala source and 913 Java sources to /home/caiiiycuk/android/mobile-yandex-client-android/app/build/retrolambda/masterAppstoreDebug...
    > BuildiAn exception has occurred in the compiler (1.8.0_77). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
    com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
    Exception executing org.gradle.api.internal.tasks.scala.ZincScalaCompiler@5fcfb08b in compiler daemon: org.gradle.api.internal.tasks.compile.CompilationFailedException: javac returned nonzero exit code.
    
    
    opened by caiiiycuk 0
Owner
saturday06
saturday06
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)

JetBrains Copilot GitHub Copilot support for the IntellIJ Platform. Installation Download the latest release. Select the Install Plugin from Disk opti

Koding 155 Dec 10, 2022
A plugin that adds support for rs2asm files to IntelliJ.

Rs2Asm This plugin adds some simple features when interacting with rs2asm files. Features Syntax highlighting Autocompletion for label names and instr

Joshua Filby 3 Dec 16, 2021
The soon-to-be-official plugin of V language for IntelliJ

intellij-vlang Template ToDo list Create a new IntelliJ Platform Plugin Template project. Get familiar with the template documentation. Verify the plu

Ned 11 Dec 29, 2022
A Gradle plugin to support the Groovy language for building Android apps

Groovy language support for Android Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google.

Groovy programming language 853 Dec 21, 2022
IntelliJ language plugin for the Kipper programming language 🦊

Kipper IntelliJ Plugin The language plugin for the Kipper programming language, which provides language support for the JetBrains IntelliJ platform. T

Luna 1 Jun 17, 2022
A Candid language plugin that provide a complete support to efficiently edit .did files.

IntelliJ Candid Language Plugin A Candid language plugin that provide a complete support to efficiently edit .did files. Candid is an interface descri

Maxime Bonvin 9 Dec 3, 2022
Gradle Replace In Place (GRIP): a gradle plugin to update your documentation or any file with a simple gradle task

GRIP (Gradle Replace In-Place) A gradle tool to update some values in your (documentation) files by running a task. (inspired by Knit) Directives Inse

Grégory Lureau 2 Oct 18, 2022
An Eclipse builder for Android projects using Scala

OBSOLETE This is an Eclipse plugin for the obsolete Android Eclipse development system, and isn't relevant for modern Scala on Android. OVERVIEW Andro

James Moore 136 Nov 25, 2022
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

 Vorlonsoft LLC 21 Oct 3, 2022
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Marcel Kliemannel 6 Jul 29, 2022
[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

#[Deprecated] Google has finally released a proper solution for unit testing. Therefore this plugin will no longer be activlty maintained. android-stu

Evan Tatarka 236 Dec 30, 2022
Kotlin compiler plugin generates support synthetic methods for use SaveStateHandle without constants and string variables.

SavedState Compiler Plugin Kotlin compiler plugin generates support methods for use SaveStateHandle without constants and string variables. Example If

Anton Nazarov 3 Sep 20, 2022
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

null 3.9k Dec 30, 2022
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jake Wharton 1.4k Dec 29, 2022
Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

Mikel 960 Dec 18, 2022
A Gradle Plugin that removes unused resources in Android projects.

#Lint Cleaner Plugin Removes unused resources reported by Android lint including strings, colors and dimensions. Depracated As of Android Studio 2.0+

Marco RS 705 Nov 25, 2022
Gradle plugin which helps you analyze the size of your Android apps.

Ruler Ruler is a Gradle plugin which helps you analyze the size of your Android apps. Motivation App size is an important metric which directly correl

Spotify 913 Dec 28, 2022