In parallel, I would like to use this project as part of an Android Studio project.
I am assume that this project produces a library; otherwise, I am not sure what you will do with it in an Android project. The question then becomes: is this library being used by other projects, separate from your planned Android Studio project?
If the answer is "yes, this library has lots of clients", then you should really consider having that library be published as an artifact to a repository. That could be a repository on your own development machine, or one on a local server for your team, or a public one (e.g., if this is an open source project). Each of your clients may need different versions of this library, and so having distinct editions of your library published as versioned artifacts would seem to be useful.
If the answer is "well, really, this Java code's JAR might be used separately, such as from the command line, but as a library, the only client is the Android Studio project", then you could set up a hybrid Android Studio/Eclipse project, moving the Eclipse project inside the Android Studio project, so it can serve as a library module.
The key then is to add a build.gradle
file to the Eclipse project/AS module that teaches Gradle/AS how to build your Eclipse project. For example, if you have the sort of file structure that pre-AS Android projects used, you might have an android
closure like this:
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
You will also need to add this module to your settings.gradle
file in the project root. At that point, other modules can use compile project(':whatever-you-call-it')
in dependencies
to pull in your library.
That being said, as sschuberth notes, Android Studio supports pure-Java modules, at least as of Android Studio 2.2. I would go that route, as two IDEs will be extremely system-intensive, since neither Eclipse nor Android Studio exactly qualifies as "svelte".