The Latest IDEA: Gradle Composite Builds and Android Studio
Using IDEA? Take a look at some of the new features in the latest preview, including a nifty tool for substituting dependencies and new features for Android Studio.
Join the DZone community and get the full member experience.Join For Free
This and all future builds will have Gradle composite builds support, so you can substitute any of your project dependencies with another project.
Imagine your project has compilation time dependencies to org.sample:number-utils and org.sample:string-utils:
Now, you’d like to change something in these libraries (a very common case). Normally, you’d need to open the sources of these libraries as separate projects, make the changes, build, upload new artifacts to the repository, then update the dependencies in your project and only after that, verify if the changes worked ok. Another change? Rinse, repeat.
With composite builds, everything is much, much simpler. All you have to is to attach the Gradle projects of these libraries via the Add button in the Gradle tool window (my-utils in our case), and then select Compose Build Configuration from the context menu for the original project.
Then, refresh your Gradle project, and you’re all set. Now you can make any changes to the attached projects and immediately get feedback—IntelliJ IDEA will use module dependencies instead of binary ones.
Note, this feature requires Gradle 3.1 or higher. Composite builds work nicely with the option that delegates the IDE build and run actions to Gradle:
We hope this will make your life a tad easier. If you’re using Maven, don’t worry: adding a similar feature for Maven is on our roadmap.
Also, in this build we have features coming from Android Studio 2.2:
- The Blueprint mode in the Designer that hides all of the visuals from views and shows only their outlines. You can choose to have it side by side with the Designer.
- Constraint Layout, a new layout manager which allows to create large and complex layouts with a flat view hierarchy. It’s similar to Relative Layout in that all views are laid out according to relationships between sibling views and the parent layout, but it’s more flexible and easier to use.
- Code Sample Browser that helps you find Google-provided Android code samples based on the currently highlighted symbol in your project.
- Many stability and reliability improvements to Instant Run. If you have previously disabled Instant Run, the Android team encourages you to re-enable it. Let us know if you come across further issues.
- Espresso Test Recorder that lets you create UI tests by recording interactions with your application. When you finish recording, it prints out the test code.
And among other news:
- Filter values in the Log viewer for Git and Mercurial are now persisted between IDE restarts.
- Support for SVN 1.8’s automatic reintegration merge.
Published at DZone with permission of Andrey Cheptcov, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.