Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Use property for publishing version string #416

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

pcrosemurgy
Copy link
Contributor

@pcrosemurgy pcrosemurgy commented Nov 2, 2022

  • Tickets addressed: None
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

The previous solution using rootProject.ext.versionForPublishing failed when building Aerie locally from a separate Gradle project, likely due to rootProject taking on a different value/meaning in that context.

Using a global property here we're able to specify the publishing version in the top-level build and guarantee that any uses of it are localized to subprojects of our top-level build.

Verification

  • Aerie is compiling and passing tests.
  • Running gradle assemble -PuseLocalAerie=true -PlocalAeriePath=../../aerie from a cloned aerie-simple-mission-model compiles the mission model without issues.

Documentation

None.

Future work

We'll want to apply this patch to the https://github.jpl.nasa.gov/Aerie/aerie-simple-mission-model repo.:

diff --git a/build.gradle b/build.gradle
index f47411b..3695094 100644
--- a/build.gradle
+++ b/build.gradle
@@ -27,19 +27,19 @@ jar {
 }

 dependencies {
-//  if (useLocalAerie == "true") {
-//    compileOnly project(':contrib')
-//    compileOnly project(':merlin-framework')
-//    implementation project(':parsing-utilities')
-//    annotationProcessor project(':merlin-framework-processor')
-//
-//    testImplementation project(':contrib')
-//    testImplementation project(':merlin-framework')
-//    testImplementation project(':merlin-sdk')
-//    testImplementation project(':merlin-driver')
-//    testImplementation project(':merlin-framework-junit')
-//  }
-//  else {
+  if (useLocalAerie == "true") {
+    compileOnly project(':contrib')
+    compileOnly project(':merlin-framework')
+    implementation project(':parsing-utilities')
+    annotationProcessor project(':merlin-framework-processor')
+
+    testImplementation project(':contrib')
+    testImplementation project(':merlin-framework')
+    testImplementation project(':merlin-sdk')
+    testImplementation project(':merlin-driver')
+    testImplementation project(':merlin-framework-junit')
+  }
+  else {
     implementation 'gov.nasa.jpl.aerie:contrib:0.13.0-SNAPSHOT-bad4548'
     implementation 'gov.nasa.jpl.aerie:merlin-framework:0.13.0-SNAPSHOT-bad4548'
     implementation 'gov.nasa.jpl.aerie:parsing-utilities:0.13.0-SNAPSHOT-bad4548'
@@ -50,8 +50,7 @@ dependencies {
     testImplementation 'gov.nasa.jpl.aerie:merlin-framework-junit:0.13.0-SNAPSHOT-bad4548'

     implementation 'gov.nasa.jpl.aerie:merlin-sdk:0.13.0-SNAPSHOT-bad4548'
-
-//  }
+  }

@pcrosemurgy pcrosemurgy temporarily deployed to e2e-test November 2, 2022 21:16 Inactive
@pcrosemurgy pcrosemurgy marked this pull request as ready for review November 2, 2022 21:17
@pcrosemurgy pcrosemurgy requested a review from a team as a code owner November 2, 2022 21:17
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically approved due to detection of the following labels: hotfix

Copy link
Collaborator

@mattdailis mattdailis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with the nuance of properties, but I do think this accomplishes the intent we're going for 👍

Really it's just a way to re-use this version logic. I had originally pasted the whole if statement into each subproject, but then decided it would be better to define it in one place.

The previous solution using `rootProject.ext.versionForPublishing` failed when building
Aerie locally from a separate Gradle project, likely due to `rootProject` taking on a different
value/meaning in that context.

Using a global property here we're able to specify the publishing version in the top-level build
and guarentee that any uses of it are localized to subprojects of our top-level build.
@pcrosemurgy pcrosemurgy force-pushed the rosemurg-publishing-version-as-property branch from 1aae4dc to a9e87b1 Compare November 2, 2022 22:27
@pcrosemurgy pcrosemurgy temporarily deployed to e2e-test November 2, 2022 22:27 Inactive
@camargo camargo merged commit 0c51130 into develop Nov 2, 2022
@camargo camargo deleted the rosemurg-publishing-version-as-property branch November 2, 2022 22:48
@camargo camargo added the build Changes that affect the build system or external dependencies label Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes that affect the build system or external dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants