Android的Studio和MonkeyTalk? [英] Android Studio and MonkeyTalk?

查看:256
本文介绍了Android的Studio和MonkeyTalk?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人成功地建立了MonkeyTalk与Android工作室?

Has anybody successfully set up MonkeyTalk with Android Studio?

在这一点上我的主要问题是,我没有看到一个方法来设置Java编译器的AspectJ

My main problem at this point is I don't see a way to set the java compiler to aspectj

我相信有一些方法来做到这一点的custom_rules.xml,但我还没有看到如何做到这一点呢。

I believe there's some way to do this in custom_rules.xml, but I haven't seen how to do this yet.

这导致了一个也许不相关的问题,但在Android的工作室,我使用(0.1.1)的最新版本,我不明白的方式从内部的Andr​​oid Studio中运行Ant构建。

This leads to a maybe unrelated problem, but in the newest version of Android Studio that I'm using (0.1.1), I don't see a way to run an ant build from inside Android Studio.

任何建议AP preciated!

Any suggestions appreciated!

推荐答案

,我已经找到很适合的方法是使用了Android的摇篮 - aspject-J插件这里找到<一href="https://github.com/uPhyca/gradle-android-aspectj-plugin">https://github.com/uPhyca/gradle-android-aspectj-plugin

An approach that I have found works well for is to use the the android-gradle-aspject-j plugin found here https://github.com/uPhyca/gradle-android-aspectj-plugin

我所做的就是创建一个新的构建类型(monkeytalk),包括猴子说话的水瓶中编译依存关系的只有的这个版本类型和应用上述的AspectJ插件。这确保了猴子聊织发生了猴子说话生成类型。

What I have done is create a new build type (monkeytalk), included the monkey talk jar as a compile dependency for only this build type and applied the above mentioned aspectj plugin. This ensures that the monkey talk weaving occurs for the monkey talk build type.

下面是一个什么我生成XML的样子

Here is a snippet of what my build xml looks like

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.5'
  }
}
apply plugin: 'com.android.application'
apply plugin: 'android-aspectj'

android {
  buildTypes {
    monkeytalk.initWith(buildTypes.debug)
    monkeytalk {
      applicationIdSuffix ".monkey"
    }
  }
}

dependencies {
  monkeytalkCompile(files("monkey-talk/monkeytalk-agent-2.0.5.jar"))
}

我还添加了一个AndroidManifest.xml文件的猴子说话生成类型添加了所需的权限,即GET_TASKS和INTERNET

I also added an AndroidManifest.xml file for the monkey talk build types which adds the required permissions, i.e. GET_TASKS and INTERNET

有关完整的示例应用程序,看看这个GitHub库 <一href="https://github.com/georgepapas/android-gradle-monkey-talk-demo/">https://github.com/georgepapas/android-gradle-monkey-talk-demo/

For a complete sample app, have a look at this github repo https://github.com/georgepapas/android-gradle-monkey-talk-demo/

这篇关于Android的Studio和MonkeyTalk?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆