Closed
Bug 1123416
Opened 10 years ago
Closed 9 years ago
Root Gradle configuration in srcdir rather than objdir
Categories
(Firefox Build System :: Android Studio and Gradle Integration, defect)
Firefox Build System
Android Studio and Gradle Integration
All
Android
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: nalexander, Assigned: nalexander)
References
Details
Attachments
(6 files)
(deleted),
text/x-review-board-request
|
sebastian
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
sebastian
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
sebastian
:
review+
|
Details |
(deleted),
image/png
|
Details | |
(deleted),
text/x-review-board-request
|
sebastian
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
sebastian
:
review+
|
Details |
Right now, |mach gradle-install| arranges a Gradle configuration in $OBJDIR/mobile/android/gradle. When IntelliJ imports that Gradle configuration, the .idea directory goes in the root, which is $OBJDIR/m/a/g. That means we can't commit .idea into version control. It also means we need to do /something/ before we can import the Gradle project into IJ (that something could be part of build-backend, or gradle-install, or ...).
It's possible that we could root the Gradle configuration in m/a/gradle and perhaps have some or all of the non-rootProject projects in the object directory. We can certainly do the |mach gradle-install|-like operations in settings.gradle.
This ticket tracks implementing enough that we can import mobile/android or mobile/android/gradle into IJ directly.
Assignee | ||
Comment 1•10 years ago
|
||
I had a shot at doing this, just recording some outcomes here.
I was able to put .idea in m/a/gradle, but the module .iml files were still in $OBJDIR. IntelliJ doesn't handle missing .iml files gracefully -- you need to re-import. This is perhaps better than having the .idea directory disappear entirely, since the project still exists in some sense? Putting the .iml files in m/a/gradle/* will be very tricky.
We still require a large number of symlinks for paths only, including in mobile/android/base. Without renaming a lot of things we're going to have a non-nested tree hierarchy in IntelliJ, which looks weird. My expectation is that we can configure Gradle to copy files from $OBJDIR that are processed without too much difficulty. (Of course, the build artifacts directory isn't a subdirectory of the src directory, so IJ shows it as a sibling, which looks weird too. No way around that that I can think of.)
Assignee | ||
Comment 2•9 years ago
|
||
Bug 1123416 - Make topsrcdir a valid Gradle project root. r?sebastian
The sub-project definitions are still in the object directory (and
still installed by |mach gradle-install); over time, we'll migrate
them out.
The Gradle wrapper and {settings,build}.gradle in topsrcdir are
identical to those in mobile/android/gradle. I don't like the
duplication, but I also don't want the burden of keeping the two
configurations identical. We'll move away from the configuration
using mobile/android/gradle as quickly as we can.
Attachment #8676365 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 3•9 years ago
|
||
Bug 1123416 - Limit IntelliJ objdir indexing. r?sebastian
IntelliJ's exclusion mechanism (for Gradle-based projects) is not very
flexible; we get just idea.module.excludeDirs. This patch crawls the
file system to skip what we can.
Attachment #8676366 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1123416 - Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
Attachment #8676367 -
Flags: review?(s.kaspari)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•9 years ago
|
||
sebastian: the sub-projects are still in the object directory. For me, that yields a tree like this.
Making the sub-projects live in the source directory is surprisingly easy, now that we've laid the foundation; we just need to mass rename The Universe.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8676365 [details]
MozReview Request: Bug 1123416 - Part 1: Make topsrcdir a valid Gradle project root. r?sebastian
Bug 1123416 - Part 1: Make topsrcdir a valid Gradle project root. r?sebastian
The sub-project definitions are still in the object directory (and
still installed by |mach gradle-install); over time, we'll migrate
them out.
The Gradle wrapper and {settings,build}.gradle in topsrcdir are
identical to those in mobile/android/gradle. I don't like the
duplication, but I also don't want the burden of keeping the two
configurations identical. We'll move away from the configuration
using mobile/android/gradle as quickly as we can.
Attachment #8676365 -
Attachment description: MozReview Request: Bug 1123416 - Make topsrcdir a valid Gradle project root. r?sebastian → MozReview Request: Bug 1123416 - Part 1: Make topsrcdir a valid Gradle project root. r?sebastian
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8676367 [details]
MozReview Request: Bug 1123416 - Part 2: Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
Bug 1123416 - Part 2: Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
Attachment #8676367 -
Attachment description: MozReview Request: Bug 1123416 - Restrict $topsrcdir/build.gradle to Fennec. r?sebastian → MozReview Request: Bug 1123416 - Part 2: Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8676366 [details]
MozReview Request: Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r?sebastian
Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r?sebastian
x
IntelliJ's exclusion mechanism (for Gradle-based projects) is not very
flexible; we get just idea.module.excludeDirs. This patch crawls the
file system to skip what we can.
Attachment #8676366 -
Attachment description: MozReview Request: Bug 1123416 - Limit IntelliJ objdir indexing. r?sebastian → MozReview Request: Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r?sebastian
Assignee | ||
Comment 9•9 years ago
|
||
Bug 1174244 - Part 4: Remove 'thirdparty_adjust_sdk' Gradle project. r?sebastian
Attachment #8676531 -
Flags: review?(s.kaspari)
Assignee | ||
Comment 10•9 years ago
|
||
Bug 1123416 - Part 5: Make a 'thirdparty' Gradle project in the source directory. r?sebastian
I don't want to cut consumers of $OBJDIR/mobile/android/gradle over
yet, so this doesn't remove the existing 'thirdparty' project.
Attachment #8676532 -
Flags: review?(s.kaspari)
Comment 11•9 years ago
|
||
Comment on attachment 8676365 [details]
MozReview Request: Bug 1123416 - Part 1: Make topsrcdir a valid Gradle project root. r?sebastian
https://reviewboard.mozilla.org/r/22677/#review20281
Attachment #8676365 -
Flags: review?(s.kaspari) → review+
Comment 12•9 years ago
|
||
Comment on attachment 8676367 [details]
MozReview Request: Bug 1123416 - Part 2: Restrict $topsrcdir/build.gradle to Fennec. r?sebastian
https://reviewboard.mozilla.org/r/22681/#review20293
Attachment #8676367 -
Flags: review?(s.kaspari) → review+
Comment 13•9 years ago
|
||
Comment on attachment 8676366 [details]
MozReview Request: Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r?sebastian
https://reviewboard.mozilla.org/r/22679/#review20297
Nice!
Btw. there's a lonely "x" in the commit message.
Attachment #8676366 -
Flags: review?(s.kaspari) → review+
Updated•9 years ago
|
Attachment #8676531 -
Flags: review?(s.kaspari) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8676531 [details]
MozReview Request: Bug 1174244 - Part 4: Remove 'thirdparty_adjust_sdk' Gradle project. r?sebastian
https://reviewboard.mozilla.org/r/22743/#review20299
Comment 15•9 years ago
|
||
Comment on attachment 8676532 [details]
MozReview Request: Bug 1123416 - Part 5: Make a 'thirdparty' Gradle project in the source directory. r?sebastian
https://reviewboard.mozilla.org/r/22745/#review20303
Attachment #8676532 -
Flags: review?(s.kaspari) → review+
Comment 16•9 years ago
|
||
This is pretty cool! I imported the root directory and it just works!
After applying the patches |mach gradle-install| (Should not be needed, right?) and |mach gradle ...| yields an error (Symlink target path does not exist: /Users/sebastian/Projects/Mozilla/fx-team/mobile/android/gradle/thirdparty_adjust_sdk/build.gradle). But I can use |gradlew ..| without issues.
Comment 17•9 years ago
|
||
Oh, and |hg st| now lists the following IntelliJ files:
> TheSilence:fx-team sebastian$ hg st
> ? fx-team.iml
> ? mobile/android/thirdparty/thirdparty.iml
Should we just add *.iml to .hgignore?
Assignee | ||
Comment 18•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/3fa48c9d205bc6628b74caf93716338935b48689
Bug 1123416 - Part 1: Make topsrcdir a valid Gradle project root. r=sebastian
https://hg.mozilla.org/integration/fx-team/rev/fe2090d75defeed0132976b20b2f9d31a9d073eb
Bug 1123416 - Part 2: Restrict $topsrcdir/build.gradle to Fennec. r=sebastian
https://hg.mozilla.org/integration/fx-team/rev/d8bf6eec26273b90f2a92c6d1e7a967ede086c2b
Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r=sebastian
https://hg.mozilla.org/integration/fx-team/rev/479539a438420df4feddae381c74c61be108bf5a
Bug 1123416 - Part 5: Make a 'thirdparty' Gradle project in the source directory. r=sebastian
Comment 19•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3fa48c9d205b
https://hg.mozilla.org/mozilla-central/rev/fe2090d75def
https://hg.mozilla.org/mozilla-central/rev/d8bf6eec2627
https://hg.mozilla.org/mozilla-central/rev/479539a43842
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Assignee | ||
Updated•7 years ago
|
Component: Build Config → Build Config & IDE Support
Product: Core → Firefox for Android
Target Milestone: mozilla44 → ---
Updated•5 years ago
|
Product: Firefox for Android → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•