android - Ability to resolve module dependencies dynamically based on version -


backstory:

in eclipse, when have multiple projects open pom files (and therefore versions), automatically use local-references if versions match 1 of listed dependencies. if don't match, relies on artifact in repo. (this handy allows live-edits/linking on active versions, while having fixed dependencies on unstable project/dependency versions).



question

in gradle, there doesn't seem way say

i depend on sub-module, version x

rather, seems able say

i depend on sub-module, don't care version, i'll take current/active one.


so, there better syntax regular:

compile project(':submodules:submodule1') 

perhaps like?:

compile project(':submodules:submodule1:0.1-snapshot') 

or

compile project('com.mydomain:submodule1:0.1-snapshot') 

perhaps not want use project references if need depend on particular version. project reference says mentioned in question. more not "i don't care version" rather "i depend on subproject - in version/state now". project references - declaring dependency on project, not particular jar/version.

if need depend on particular version, should declare without project dependency, such as:

compile('com.mygroupid:submodule1:0.1-snapshot') 

which shortened version of

compile(group:'com.mygroupid', name:'submodule1', version:'0.1-snapshot') 

by default, use artifact repo. there solution may bring closer want. eclipse-integration-gradle plugin can detect such dependencies , replace them project dependencies eclipse. option called "remap jars gradle projects".

as result, if there target project in eclipse workspace name corresponds target module, such eclipse project used instead of repo jar.

i not sure whether possible multiple versions of same project in same workspace (if needed).


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -