我如何使用Graclj使用Clojure的Andr​​oid Studio中? [英] How do I use Clojure in Android Studio using Graclj?

查看:244
本文介绍了我如何使用Graclj使用Clojure的Andr​​oid Studio中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最终目标是能写的Clojure应用程序的机器人,使用Android Studio和狂草。我开始与leiningen却发现,这是一个构建系统,独立于什么Andoid工作室即使用摇篮。所以,我想用leiningen的IntelliJ,但不能得到Android的部署,除了在命令行工作。因为我想与Android整合工作室,我决定尝试Graclj: https://github.com/graclj/graclj 这是一个摇篮插件Clojure的。

我可以得到Graclj教程Android Studio中运行的,按本指南:
https://github.com/graclj/learning-graclj/tree/learning -0.1.0

不过:<​​/ P>


  • Graclj预计的Clojure src和内置类和罐子在根项目

  • Android的工作室预计src和类是在应用程序子项目

  • 后,我结束了单独的摇篮教程建立Graclj和Android Studio的任务,但我不知道如何将它们整合

所以,任何人都可以提出一个方法,我可以挂接到Andoid Studio的构建过程?


  • 我是否需要更改某些设置为Graclj插件来做到这一点?如果是这样,怎么样?

  • 请我需要改变某些Android Studio插件的设置?

  • 请我需要添加/更改东西在摇篮构建脚本?

  • 我现在去往下来了死胡同? ; - )

我已经看过了Android Studio的生成过程:的http://开发商。 android.com/tool​​s/building/configuring-gradle.html
但我不知道足够的摇篮知道我应该在这里做什么。

如果我需要提供更多的信息,只问。

任何帮助AP preciated!


解决方案

Unfortuantely,我没有任何Android(更不用说Android的一室公寓)的经验​​。不过,我会尽我所能基于摇篮/ Graclj知识解答。

Graclj并不要求您使用根项目。您可以在任何您在构建有项目的应用插件(S)。但是,我不知道该怎么好喜欢Graclj基于模型的插件将与传统的Andr​​oid插件工作。你可以尝试的实验一这是使用模式的方法,虽然有一个像样的机会,这将不兼容,除非有一个与摇篮2.12。

工作

另外,你也许能够依赖增加对Graclj(你还可以把它放到一个项目中除了根)产生的JAR Android应用项目。不知道是否有这样做一个很好的方法(还没有尝试过我自己)。

  {相关性
   //哪一个你在使用Graclj我-其他-凸出感
   编制项目(':我-其他-PROJ')
}

或者,也许你需要它在我-其他-凸出与传统的插件互操作首先添加到配置:

 文物{
   档案createMainJar
}

这可能是你在一个死胡同(现在)。 Graclj是很新的,所以这个东西应该都是可能的最终。

My ultimate goal is to be able to write Clojure apps for Android, using Android Studio and Cursive. I started with leiningen but found out that it is a build system that is independent of what Andoid Studio uses ie Gradle. So I tried leiningen with Intellij, but couldn't get Android deploys to work except from the command line. Since I wanted to integrate with Android Studio, I decided to try Graclj: https://github.com/graclj/graclj which is a Gradle plugin for Clojure.

I can get the Graclj tutorial running in Android Studio, as per this guide: https://github.com/graclj/learning-graclj/tree/learning-0.1.0

However:

  • Graclj expects the Clojure src and built classes and jars to be in the root project
  • Android Studio expects src and classes to be in the app subproject
  • After the tutorial I end up with separate Gradle build tasks for Graclj and Android Studio but I don't know how to integrate them

So, can anyone suggest a way that I can hook into Andoid Studio's build process?

  • Do I need to change some settings to the Graclj plugin to do this? If so, how?
  • Do I need to change some Android Studio plugin settings?
  • Do I need to add/change something in the Gradle build scripts?
  • Am I heading down a dead end? ;-)

I have looked at the Android Studio build process: http://developer.android.com/tools/building/configuring-gradle.html but I don't know enough about Gradle to know what I'm supposed to be doing here.

If I need to supply any more info, just ask.

Any help appreciated!

解决方案

Unfortuantely, I don't have any Android (let alone Android Studio) experience. However, I'll do my best to answer based on Gradle/Graclj knowledge.

Graclj does not require you to use the root project. You can apply the plugin(s) in any of the projects that you have in your build. However, I don't know how well a model-based plugin like Graclj will work with the "traditional" Android plugin. You could try the "experimental" one that's using the model approach, though there's a decent chance that it won't be compatible unless there's one that works with Gradle 2.12.

Alternatively, you might be able to add a dependency to the Android app project on the JAR produced by Graclj (which you may still want to put in a project besides the root). Not sure if there's a very good way to do this (haven't tried myself).

dependencies {
   // my-other-proj being whichever one you use Graclj in
   compile project(':my-other-proj')
}

Or maybe you would need to add it to a configuration first in the my-other-proj to interop with traditional plugins:

artifacts {
   archives createMainJar
}

It is possible that you're at a dead end (for now). Graclj is very new, so this stuff should all be possible eventually.

这篇关于我如何使用Graclj使用Clojure的Andr​​oid Studio中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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