-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added possibility to override context properties in build.yml #213
Conversation
@@ -248,6 +249,15 @@ private PlatformConfig getPlatformConfig(String platform) throws ExtenderExcepti | |||
return platformConfig; | |||
} | |||
|
|||
private String getPlatformConfigProperty(String property) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows us to get properties from the PlatformConfig class (read form build.yml)
E.g. "x86_64-win32" will take precedence over the "common" platform.
@@ -216,7 +209,7 @@ public boolean accept(File file) { | |||
if (manifest.platforms.containsKey("common")) { | |||
Object v = manifest.platforms.get("common").context.get(name); | |||
if( v != null ) { | |||
if (!Extender.isListOfStrings((List<Object>) v)) { | |||
if (!ExtenderUtil.isListOfStrings((List<Object>) v)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird circular dependency between this util file and the Extender.java. :/
} | ||
|
||
if (v1 != null && v2 != null && v1 instanceof List) { | ||
//System.out.printf("merge op %s : %s + %s (merge: %s)\n", key, v1.toString(), v2.toString(), isMergeOp?"true":"false"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
if (isMergeOp) { | ||
v1 = ExtenderUtil.mergeLists((List<String>) v1, (List<String>) v2); | ||
} else { | ||
v1 = v2; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the property name ends with "_replace", the else-path here is taken, and we keep the v2 value as-is.
If not, we use the backwards compatible way of merging the two lists v1 and v2.
@@ -11,7 +11,7 @@ | |||
public String exePrefix; // deprecated | |||
public String exeExt; // deprecated | |||
public String writeLibPattern; | |||
public String writeShLibPattern = new String(); | |||
public String writeShLibPattern; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having it as "null" makes it easier to check for overrides between the platform config instances.
@@ -239,6 +239,7 @@ | |||
} | |||
|
|||
private PlatformConfig getPlatformConfig(String platform) throws ExtenderException { | |||
PlatformConfig commonPlatformConfig = config.platforms.get("common"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I started out with one idea of "merging" these two classes into one (might do later on), but instead implemented the getPlatformConfigProperty() instead for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See note on unused variable
private static final String MERGE_KEY_REPLACE = "_replace"; | ||
static private boolean isMergeOp(String name) | ||
{ | ||
if (name.endsWith(MERGE_KEY_REPLACE)) | ||
return false; | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: Do we have a better way than this? Better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't think of anything right now to be honest.
No description provided.