Skip to content

Commit

Permalink
fix define overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus committed Aug 29, 2023
1 parent 6de27a4 commit 18c8d23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- switched from ScriptableObject Settings to ScriptableSingleton

## [0.1.6] - 2023-08-29
### Fixed
- fix define overwrite
9 changes: 2 additions & 7 deletions Editor/HeadlessBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ static void BuildGeneral(DistributionPlatform distributionPlatform) {
if (!string.IsNullOrEmpty(defines)) {
customOverwriteDefines = true;
customDefines = defines.Split(',');
Debug.Log("===== define attribute not null =====");
}

Debug.Log("===== define attribute =====" + defines + " - " + customOverwriteDefines);

string distributionBranch = "";

//Set Defines
Expand All @@ -84,17 +81,15 @@ static void BuildGeneral(DistributionPlatform distributionPlatform) {

case DistributionPlatform.GOG:
if (customOverwriteDefines) {
Debug.Log("===== custom overwrite defines =====");
definesBackup = EditorHelper.Utility.GetDefinesForTargetGroup(targetGroupModule.activeTargetGroup.group);
PlayerSettings.SetScriptingDefineSymbolsForGroup(targetGroupModule.activeTargetGroup.group, DefineArrayToString(customDefines));
} else {
Debug.Log("===== internal overwrite defines =====");
OverwriteDefines(Settings.Headless.gog.enabledDefinesOverwrite.ToList());
}
break;
}

Debug.Log("===== Defines: " + string.Concat(EditorHelper.Utility.GetDefinesForTargetGroup(targetGroupModule.activeTargetGroup.group)) + " =====");
Debug.Log("===== Defines =====" + string.Join("\n", EditorHelper.Utility.GetDefinesForTargetGroup(targetGroupModule.activeTargetGroup.group)));

DeleteFilesAndFoldersOfBuildsFolder();
buildProcessModule.SaveHeadless(distributionPlatform, isDevBuild, buildtarget, distributionBranch, appID, upload);
Expand All @@ -121,7 +116,7 @@ static void OverwriteDefines(List<string> enabledDefines) {
}
} else {
if (!enabledDefines.Contains(defines[i])) {
defines[i] = defines[i].TrimStart('*');
defines[i] = '*' + defines[i];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.gentlymadstudios.buildmanager",
"version": "0.1.5",
"version": "0.1.6",
"displayName": "BuildManager",
"description": "BuildManager by Gentlymad Studios.",
"unity": "2022.1",
Expand Down

0 comments on commit 18c8d23

Please sign in to comment.