Posts

Showing posts with the label gradle

Using TreeTranslator to rename functions not working for Kotlin

Image
Using TreeTranslator to rename functions not working for Kotlin I am trying to rename a method in a Java interface and a function in a Kotlin interface during building according to AST (Abstract Syntax Tree) rewriting. For this question we ignore the implications that renaming a method/function brings for invocations. To find the method/function to rename I am using a custom annotation and annotation processor. I have it working for the Java interface by following these instructions. I created a new project with three modules. The app module, annotation module and annotation processor module. The app module is an Android App and contains two separate Java and Kotlin interface files with one annotated method/function each. RenameJava.java package nl.peperzaken.renametest; import nl.peperzaken.renameannotation.Rename; public interface RenameJava { @Rename void methodToRename(); } RenameKotlin.kt package nl.peperzaken.renametest import nl.peperzaken.renameannotation.Rename interfa...

Product flavor specific gradle dependencies on Unity

Product flavor specific gradle dependencies on Unity Unity offers a custom mainTemplate.gradle file to be used as build.gradle after project export and for dependencies it uses the following; dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) **DEPS**} Problem here is that I have two productFlavors and I want some of the libraries to be product flavor specific. So the output is; compile(name: 'play-services-plus-10.2.0', ext:'aar') compile(name: 'play-services-tasks-10.2.0', ext:'aar') compile(name: 'unity-ads', ext:'aar') compile project(':gameCircle-2.4.2') What I'm looking for is an output like this; googleCompile(name: 'play-services-plus-10.2.0', ext:'aar') googleCompile(name: 'play-services-tasks-10.2.0', ext:'aar') compile(name: 'unity-ads', ext:'aar') amazonCompile project(':gameCircle-2.4.2') What is the best way to approach this...

copy file in android template changed the file content

copy file in android template changed the file content I modify the Android Studio's project-template, in the recipe.xml file, I add one line: <copy from="root/Key" to="${escapeXmlAttribute(topOut)}/Key" /> and when I create new Android project, the Key indeed was created, but actually the file was modified, and I can't use it which gave errors: java.io.IOException: Invalid keystore format at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:658) at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:56) at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224) at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:70) at java.security.KeyStore.load(KeyStore.java:1445) at sun.security.tools.keytool.Main.doCommands(Main.java:795) at sun.security.tools.keytool.Main.run(Main.java:343) at sun.security.tools.keytool.Main.main(Main.java:336) ...