summaryrefslogtreecommitdiff
path: root/android-gradle-jps
AgeCommit message (Collapse)Author
2015-04-23Android Studio does not pass JVM args to Gradle when building with JPS.Alex Ruiz
Fixes https://code.google.com/p/android/issues/detail?id=169743 Change-Id: I1d53af370b17f1720bbf6b2aa2aa8a972235ab61
2015-03-17gradle output parser for Android projects: allow plugins to provide their ↵nik
own parsers (restored) (cherry picked from commit 117a087, rev by Vlad)
2015-02-05Merge remote-tracking branch 'aosp/upstream-idea14' into merge-upstreamTor Norbye
Conflicts: adt-branding/src/idea/AndroidStudioApplicationInfo.xml android/guiTestSrc/com/android/tools/idea/tests/gui/framework/fixture/ExecutionToolWindowFixture.java android/resources/messages/AndroidBundle.properties android/src/META-INF/plugin.xml android/src/com/android/tools/idea/avdmanager/AvdEditWizard.java android/src/com/android/tools/idea/avdmanager/AvdWizardConstants.java android/src/com/android/tools/idea/configurations/LocaleMenuAction.java android/src/com/android/tools/idea/gradle/project/PostProjectSetupTasksExecutor.java android/src/com/android/tools/idea/gradle/variant/view/BuildVariantView.java android/src/com/android/tools/idea/lang/proguard/ProguardFileTypeFactory.java android/src/com/android/tools/idea/sdk/DefaultSdks.java android/src/com/android/tools/idea/templates/Template.java android/src/com/android/tools/idea/wizard/NewAndroidModulePath.java android/src/org/jetbrains/android/actions/RunAndroidAvdManagerAction.java android/src/org/jetbrains/android/sdk/AndroidSdkUtils.java android/testSrc/com/android/tools/idea/welcome/AndroidVirtualDeviceTest.java Change-Id: I9825f81c2fe13f44c3f4571c33c1a2eb29703f18
2015-01-28Fix build breakage.Alex Ruiz
Change-Id: I77361803843a1156cda3d3616819fda33ab77dcc
2015-01-28resolve merge conflicts of dbce7bf to studio-1.2-dev.Alex Ruiz
Change-Id: I798acd181c89d7bb76d9f075f183040a3cebfc68
2015-01-27Move AAPT parser from studio to gradle.Chris Warrington
Allows rewriting of AAPT error messages in the Gradle plugin. Moved from android-common to sdk-common. Change-Id: I0aa722232cb1b80c40256c0266177cb8bfe867cd
2014-10-29Cleanup (annotation; arrangement)Roman Shevchenko
2014-10-02Merge branch 'studio-1.0-release' of ↵Eugene Kudelevsky
https://android.googlesource.com/platform/tools/adt/idea into android-tmp Conflicts: adt-branding/src/idea/AndroidStudioApplicationInfo.xml android-gradle-jps/src/com/android/tools/idea/jps/builder/AndroidGradleTargetBuilder.java android/android.iml android/common/testSrc/com/android/tools/idea/gradle/output/parser/BuildOutputParserTest.java android/src/META-INF/plugin.xml android/src/com/android/tools/idea/configurations/ConfigurationAction.java android/src/com/android/tools/idea/ddms/screenshot/DeviceArtPainter.java android/src/com/android/tools/idea/gradle/invoker/GradleOutputForwarder.java android/src/com/android/tools/idea/gradle/invoker/GradleTasksExecutor.java android/src/com/android/tools/idea/gradle/projectView/AndroidTreeStructureProvider.java android/src/com/android/tools/idea/startup/AndroidStudioSpecificInitializer.java android/src/com/android/tools/idea/wizard/ImportWizardModuleBuilder.java android/src/org/jetbrains/android/AndroidPlugin.java android/src/org/jetbrains/android/exportSignedPackage/GradleSignStep.java android/src/org/jetbrains/android/facet/AndroidRootUtil.java android/src/org/jetbrains/android/facet/IdeaSourceProvider.java android/src/org/jetbrains/android/maven/AndroidFacetImporterBase.java android/src/org/jetbrains/android/run/AndroidDebugRunner.java android/testSrc/com/android/tools/idea/gradle/stubs/gradle/GradleProjectStub.java android/ultimate/src/org/jetbrains/android/database/AndroidDataSource.java android/ultimate/src/org/jetbrains/android/database/AndroidDataSourcePropertiesDialog.java
2014-09-19gradle output parser for Android projects: allow plugins to provide their ↵nik
own parsers
2014-08-07Fixed bug 73640 in JPS builder.Alex Ruiz
The bug is about the IDE invoking "assemble" Gradle task for modules that are of "local AAR" type. This type of module do not have the "assemble" task and when building the project the IDE should just skip them. This bug was already fixed in the GradleInvoker strategy (in-process build) in https://android-review.googlesource.com/103541 but it was not fixed in the JPS build (out-of-process build.) The solution to the problem is to carefully add the "Java" facet only to the non-Android modules that have the "compileJava" task. Then we would only build the modules with either the Android or Java facet. The main problem with this solution is that we need a "Java facet" counterpart in the JPS world. When dealing with JPS each facet needs to have 2 copies: one for the IDE and one for JPS. The need for the facets is to be able to figure out which Gradle tasks to call. We were doing this on both GradleInvoker and JPS, duplicating the logic on both sides. This CL introduces a better solution: all the Gradle tasks to invoke are figured out in one place: the IDE. Then the IDE will pass the list of tasks to JPS via Java properties. This way, we have only one place where this logic lives, and we can remove a lot of duplicated code in the JPS side. Finally fixes issue https://code.google.com/p/android/issues/detail?id=73640 Change-Id: Ib22de9b654ca975f9ce66bcf80899ce2936b9a37
2014-08-07Fixed bug where compiler errors where not shown by JPS builder.Alex Ruiz
This issue appears when the output parsers do not recognize the output of stderr (this is the case when the error comes from Gradle itself, and not a 3rd-party tool like javac.) The fix is to create an error message from stderr, which contains the cause of the failure. This CL also updates UI test MultipleModuleTypeCompilationTest to reproduce the issue and verify that is properly fixed. In addition, IdeFrameFixture now guarantees that GradleInvoker (in-process Gradle builds) is always enabled. Change-Id: Iafbf4105e236e7f42f0f1df8a8f464824ac28131
2014-07-15Merge remote-tracking branch 'aosp/upstream-133' into merge-upstreamTor Norbye
Conflicts: android-gradle-jps/src/com/android/tools/idea/jps/builder/AndroidGradleTargetBuilder.java android/testSrc/com/android/tools/idea/gradle/stubs/gradle/GradleProjectStub.java Change-Id: I16f8afda0a821424af8335278a92fcc7ad0c520b
2014-07-10make compatible with guava-17Eugene Kudelevsky
2014-07-09Merge branch 'master' of ↵Eugene Kudelevsky
https://android.googlesource.com/platform/tools/adt/idea
2014-07-07make the code compatible with guava_17Eugene Kudelevsky
2014-07-03upgrade Guava to v17Maxim.Mossienko
2014-06-16Updating code base to use plug-in 0.12.0.Alex Ruiz
This CL depends on: https://android-review.googlesource.com/97066 Change-Id: I01e7f5733488580391b8bfd37bf4960356145340
2014-06-06When invoking Gradle, we pass parameters as project properties.Alex Ruiz
This way we ensure we don't create new Gradle daemons. This CL depends on: https://android-review.googlesource.com/97034 https://android-review.googlesource.com/97043 Change-Id: Ifd6595c185260c814b2a07713219395e33eb2447
2014-06-06Added support for parsing structured messages coming from Android Gradle ↵Alex Ruiz
plug-in. In this CL, we invoke Gradle passing the JVM arg "android.invoked.from.ide". The Android Gradle plug-in, when detecting this argument, will format any warning/error messages using the pattern: message_type|gradle_project_path|message As part of this CL, we parse this output, create the appropriate message for the "Messages" window and link to the build.gradle file in the module with a matching Gradle path. This CL also fixes broken tests in BuildOutputParserTest. Change-Id: I2912467ef5dfcb2f5b7923d3c5290feda5613595
2014-05-29Fixed timeout of Gradle daemons.Alex Ruiz
By default IDEA gives Gradle daemons 1 minute to stay idle, when the default is 3 hours. This setting causes Gradle to create daemons pretty often, which has a lot of overhead. The way IDEA sets the timeout is through a system property. In this CL we override set the corresponding system property to -1, so IDEA won't change the default value. This system property only affects project sync. We were setting the same default (1 minute) in project builds (both JPS and GradleInvoker.) This CL fixes the daemon timeout for project builds as well. Change-Id: Ibf82655f8e053489dbf29d00c1532cfe06de56a1
2014-05-19More small improvements to "Messages" window.Alex Ruiz
- Usage of Gradle incubating features is shown as warning. - Usage of Gradle deprecated features is shown as warning. - Build time is shown as info. - Build status (e.g. SUCCESSFUL) is shown as info. - Status message changed from "Gradle invocation completed successfully" to "Gradle build finished" (original message was confusing when having errors and warnings.) This CL also refactors/cleans up code a bit. Change-Id: I53516c252d6ecccf75749477c59dfe077aeab11f
2014-04-17explicit 1.6 language level/compilation targetAnna Kozlova
2014-04-10Now we pass option --configure-on-demand to Gradle builds.Alex Ruiz
This option tells Gradle to configure only the sub-projects (or modules, in IDEA lingo) that are going to be built, instead of all the sub-projects in a given project. The result is faster builds for multi-project projects. Gradle docs: http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand This CL adds a new option in the Compiler > Gradle preference page to allow users to enable/disable this option (it is "enabled" by default.) Change-Id: Ia6ccb72a653b0c96e8fca191d9058023b10a62cf
2014-04-04Fixed bug where items were added to an unmodifiable list.Alex Ruiz
Fixes: https://code.google.com/p/android/issues/detail?id=67679 Change-Id: Iffafc77d08b7140894cfef2717ae2f61da8185aa
2014-03-22Improved handling of 'buildSrc' folder.Alex Ruiz
'buildSrc' is a special folder in Gradle that gets compiled automatically. When an Android project has this folder, the IDEA android plug-in is not configuring the module corresponding to this folder because the Gradle infrastructure in IDEA does not let us know about the other modules in the project. Until we have the chances we need in IDEA to decide whether 'buildSrc' is part of an Android project, we assume it is if the IDE is Android Studio. This is a short-term workaround. Also, this CL adds a change where we skip building this folder explicitly, because it is handled automatically by Gradle. Change-Id: I91d15d1458dda3b85404613827604d8537917094
2014-03-05Added support for "assembleTranslate".Alex Ruiz
Per conversation with Xav and Xiaomei, this CL: - Adds a new build mode, ASSEMBLE_TRANSLATE, that ultimately invokes Gradle task "assembleTranslate" - Passes the JVM arg "enableTranslation" to the Android Gradle plug-in Change-Id: Ib92b5e7d7b6cad299e6926005f35776db5d80275
2014-02-24Now "Clean Project" action cleans the project *and* generate sources.Alex Ruiz
Before this action only cleaned the project, which pretty much was just deleting the "build" folder, and since a lot of the IDE functionality depends on generated sources, cleaning the project left the IDE in inconsistent state. Change-Id: I7766b8f446d4c73e607232ea0ee944d5a7e53ff4
2014-02-06Now we always show unparsed compiler messages in the "Messages" view.Alex Ruiz
Fixes https://code.google.com/p/android/issues/detail?id=65615 Change-Id: Ic2889a68d41fdd4f683da7a2233251c6a409a34e
2014-01-06Fixed builds for project with failed Gradle sync.Alex Ruiz
This CL does the following, when building (make) a project with failed Gradle sync: - Call "assemble" since there is no model, we don't have any information about available tasks - If the build had 0 errors, we automatically trigger an import (hoping that since there were no errors, sync will be successful) Change-Id: I1fd6c91e0895c25804e224a8beea36f52165d1ba
2014-01-06Added command-line options to project builds.Alex Ruiz
With this CL, users will be able to specify command-line options when building Android-Gradle projects (e.g. --stacktrace.) Command-line options can be set in the preference page "Compiler" > "Gradle". The page also contains a hyperlink to Gradle's command-line option documentation. Change-Id: I02026e9978307a5315988baad6529d61c3a40632
2013-12-16Unified execution of "after build" tasks.Alex Ruiz
We currently have a set of tasks that we execute after each build: - Notify user that unresolved dependencies were detected in offline mode, and suggest to go online - Refresh Studio's view of the file system (to see generated files) - Remove any build-related data stored in the project itself (e.g. modules to build, current "build mode" like generate source, make, etc.) - Notify projects that source generation is finished. The problem is that we have calls to these tasks in 2 separate places: 1. AndroidGradleProjectComponent: when using JPS builders 2. GradleInvoker and GradleTaskExecutor: when invoking Gradle directly This CL unifies the place where these post-build tasks are invoked, making code maintenance easier. Change-Id: I9b0ee3894722e83f8576d3bde48f3763fc85990a
2013-12-05Adding 'offline' mode to builds.Alex Ruiz
This CL adds 'offline' build mode to both 'direct Gradle invocation' and JPS builders. Partial fix for https://code.google.com/p/android/issues/detail?id=58151 We still need to add support for 'offline' project sync (affects 'New Project', 'Import Project' and 'Sync with Gradle files' actions.) This change needs to happen in the IDEA's 'External System Import' framework. I'll work on that part shortly. Change-Id: I7b1e77ddcdf2ef362add502bb40d7ed8359dca8d
2013-11-12Build tests for Java modules.Siva Velusamy
This CL adds a task to compile a Java module's test classes when compilation is invoked in the context of a JUnit run configuration. Fixes: https://code.google.com/p/android/issues/detail?id=60916 Change-Id: Ic56606109837287bbf0fa1d2b711598463512e2a
2013-11-05Fixes to the new build approach.Alex Ruiz
1. Unparsed output is no longer displayed in the "Messages" window, since all the Gradle output is displayed in the Gradle Console. 2. Fixed the column position in compiler errors. 3. Gradle Console now displays the Gradle tasks that will be executed. 4. "Messages" window now has the message "See complete output in console" and when users double-click it, it will activate the Gradle Console. Change-Id: I7fbd2debbe6022be73ca32926b5a0fc3e9a282a0
2013-11-04Merge remote-tracking branch 'aosp/upstream-master' into merge-upstreamTor Norbye
Conflicts: android-gradle-jps/src/com/android/tools/idea/jps/AndroidGradleJps.java android/src/com/android/tools/idea/gradle/project/AndroidGradleProjectComponent.java android/src/com/android/tools/idea/gradle/project/AndroidGradleProjectResolver.java Change-Id: I0da1fde0e1fcae971d9c994eaadc5eea35baeb2c
2013-11-04Added "Clean Project" action.Alex Ruiz
This action appears in the "Build" action group. Change-Id: Idba89c03c36dfc02155e6f76bf1a4f11fa6233a8
2013-11-03Enabled building selected modules.Alex Ruiz
(By "building" we mean "making" and "compiling.") Currently, Android Studio builds all the modules in the project. Users have reported that they only want to build certain modules. This CL enables that. The main issue with JPS is that it is impossible to have a 'target builder' (in JPS terminology) that knows about all the selected modules in the IDE (JPS has no notion of an IDE.) The most that we can get from JPS is to have one 'target builder' per module, and these target builders won't know about each other, making it impossible to have a single call to Gradle passing the tasks to execute per selected module (we would end with a call to Gradle per module.) To work around this, we have a back door: we have an extension point in JPS where we can pass JVM args to the JPS process (we requested that some time ago.) In this CL we pass the names of the selected modules (if any) to as JVM parameters to the JPS process. On the other hand, it is really easy to implement building selected modules in the new build strategy. In addition, this CL: - Fixes the "update" mechanism of the "Make Module(s)" and "Compile Module(s)". - Makes it possible to compile a module if any of its files is selected. - Unifies the way Gradle tasks to execute are calculated (for both JPS and direct Gradle invocation,) fixing bugs in both build approaches. - Does not call "assemble" on pure Java libraries when generating sources. - Cleans up code. - Adds more tests. Fixes https://code.google.com/p/android/issues/detail?id=59915 Change-Id: I4f24fbfd4773d37c0276ee7b6815d85f6b312fa0
2013-10-23Moved Gradle output parsers to android-common.Alex Ruiz
These classes no longer depend on JPS APIs. Change-Id: I9de51046bfda9db194e5d9835e71bfe54e983ddb
2013-10-21fix caseEugene Kudelevsky
2013-10-21show warning that non-gradle java module cannot be compiled if there is ↵Eugene Kudelevsky
android-gradle module in the project
2013-10-14Handle error output from Gradle plugin 0.6.2, with better merging errorsTor Norbye
In version 0.6.2 of the Gradle plugin, we now emit more regular exceptions for things like XML errors and AAPT name validation errors. This changeset adds a suitable error parser, as well as unit tests. Change-Id: I57c44236663b770f186fffe156248da742633647
2013-10-14Now we consistently call "generate sources" when importing a project.Alex Ruiz
Change-Id: I720248b6889c5d4b129cee7dca54a62b452d472a
2013-10-11Removed unnecessary work when importing and building projects.Alex Ruiz
- Importing a project (new or existing) now only performs a single call to Gradle (by default, IDEA's call Gradle twice: the first time as a "preview" mode and the second time for resolving dependencies in the background.) We do everything in the first pass ("preview" mode) and return and empty project on the second. - Importing or opening an existing project only calls the Gradle tasks to clean and generate sources, instead of compiling code. - Importing a project that has unresolved dependencies won't trigger a build anymore. Change-Id: I01d15ef744b9a6013d11175075c3d3d1d578449c
2013-10-10Added HTTP proxy settings to Gradle daemon used for building.Alex Ruiz
HTTP proxy settings are already being set for importing projects. It is necessary to keep system properties between the process that imports a project and the one that builds a project. This way they can use only one Gradle daemon. If system properties differ, Gradle will start a new daemon, which uses a significant amount of energy. Change-Id: I33894575c306c028cc4c4ab9edaf61519bf627a7
2013-10-0859444: Failed to import Gradle project: Problems pinging owner of lockTor Norbye
When this error happens, add an error message which explains that you may just want to try another build. Change-Id: I6491a44816fc707546a758e14e883358eccdd0ce
2013-10-04Update error parser to account for error message changeTor Norbye
In https://android-review.googlesource.com/#/c/67120/ the error message format was changed a bit; this tweaks the error parser to handle both types of formats (and adds a unit test.) Change-Id: Id92580784342ff9febc38cf01ee91b122872ce95
2013-09-27Regression test for mismatched XML parsing errorTor Norbye
Regression text for issue 59824. Change-Id: I05b93021f8b5a2132291bd0ea649450e8830cb7b
2013-09-23Gradle error message handling for duplicate resourcesTor Norbye
Change-Id: I2647e958172def028f2052a4f43061256199d69f
2013-09-18Detect <include> tag cycles in layoutsTor Norbye
If there are cyclic dependencies in the layouts, detect this during rendering and emit a suitable warning message (displaying the dependency chain) and stop rendering. Before this, you'd just (eventually) get a StackOverflowException with no further details. Also use the new file<->URL conversion utilities in SdkUtils. Change-Id: I0f11dac9d8501e478a809af2338de15cde470f2c
2013-09-1760050: Build fails if project path contains two dashesTor Norbye
This changeset makes the error parser (which handles embedded path references pointing to the pre-merge sources of XML files) handle file URLs that contain escaped characters, such as %2D for dashes -- which is necessary when paths contain double dashes, since those are not valid in XML comments. (There is a corresponding fix in the merge writer used by the android plugin which ensures that paths are escaped when necessary.) Change-Id: I53d7af26ed1dacf96cf9018edfa5729b7b21f605