Android Scala and Gradle

I am new to Gradle. Is there an example of how to properly configure gradle -android-plugin for scala classes.

this is what i have now.

buildscript { repositories { mavenCentral() } dependencies { classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1' } } apply plugin: 'android' apply plugin: 'eclipse' apply plugin: 'scala' sourceCompatibility = 1.6 version = "1.0.0" repositories { mavenCentral() } dependencies { compile files('/home/pcu/workspace/workspace-android/emoo/libs/android-support-v4.jar') compile 'org.scala-lang:scala-library:2.9.1' scalaTools 'org.scala-lang:scala-compiler:2.9.1' scalaTools 'org.scala-lang:scala-library:2.9.1' } task configureDebug << { jar.classifier = "debug" } task configureRelease << { proguard.enabled = true } 

but compilation fails. scala class is not compiled.

+4
source share
1 answer

This is actually a lot easier with the right plugin:

https://github.com/saturday06/gradle-android-scala-plugin

It worked great for me.

You only need about 3 lines in your gradle and potentially proguard configuration to reduce apk size.

The setup is well documented on the github page. Everything except steps 1-3 is optional.

+1
source

Source: https://habr.com/ru/post/1443100/


All Articles