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

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

问题描述

有人用 Android Studio 成功设置过 MonkeyTalk 吗?

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 Studio (0.1.1) 中,我没有看到从 Android 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.

感谢任何建议!

推荐答案

我发现一种很有效的方法是使用这里的 android-gradle-aspject-j 插件 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),包括monkey talk jar 作为 这种构建类型的编译依赖项,并应用了上面提到的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 存储库https://github.com/georgepapas/android-gradle-monkey-talk-演示/

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天全站免登陆