From 2518a28b41ddf3008c362fd4fbc933ffc95bef65 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Tue, 20 Aug 2024 10:26:57 +0200 Subject: [PATCH 1/8] Added parsing of formatVormat version to the config loader. --- regolith/config.go | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/regolith/config.go b/regolith/config.go index 46913cde..2da2abef 100644 --- a/regolith/config.go +++ b/regolith/config.go @@ -1,6 +1,9 @@ package regolith -import "github.com/Bedrock-OSS/go-burrito/burrito" +import ( + "github.com/Bedrock-OSS/go-burrito/burrito" + "golang.org/x/mod/semver" +) const StandardLibraryUrl = "github.com/Bedrock-OSS/regolith-filters" const ConfigFilePath = "config.json" @@ -42,6 +45,7 @@ type RegolithProject struct { Profiles map[string]Profile `json:"profiles,omitempty"` FilterDefinitions map[string]FilterInstaller `json:"filterDefinitions"` DataPath string `json:"dataPath,omitempty"` + FormatVersion string `json:"formatVersion,omitempty"` } // ConfigFromObject creates a "Config" object from map[string]interface{} @@ -109,6 +113,34 @@ func RegolithProjectFromObject( Profiles: make(map[string]Profile), FilterDefinitions: make(map[string]FilterInstaller), } + // FormatVersion + if version, ok := obj["formatVersion"]; !ok { + Logger.Warnf("Format version is missing. Defaulting to 1.0.0") + result.FormatVersion = "1.0.0" + } else { + formatVersion, ok := version.(string) + if !ok { + return result, burrito.WrappedErrorf( + jsonPropertyTypeError, "formatVersion", "string") + } + result.FormatVersion = formatVersion + vFormatVersion := "v" + formatVersion + if semver.IsValid("v" + formatVersion) { + return result, burrito.WrappedErrorf( + "Invalid value of formatVersion. The formatVersion must "+ + "be a semver version:\n"+ + "Current value: %s", formatVersion) + } + const latestCompatibleVersion = "2.0.0" + if semver.Compare(vFormatVersion, "v"+latestCompatibleVersion) < 0 { + return result, burrito.WrappedErrorf( + "Incompatible formatVersion: \n"+ + "Current version: %s\n"+ + "Latest compatible version: %s\n", + formatVersion, latestCompatibleVersion) + } + } + // DataPath if _, ok := obj["dataPath"]; !ok { return result, burrito.WrappedErrorf(jsonPropertyMissingError, "dataPath") From b76d2accc430154b5df40da6da2248478633b2fc Mon Sep 17 00:00:00 2001 From: Nusiq Date: Tue, 20 Aug 2024 13:43:32 +0200 Subject: [PATCH 2/8] Implemented format version 2.0.0 of export target: - Available 'target' property values - 'development', 'exact', 'world' and 'local' - The 'local' and 'exact' targets work the same as in the previous version - The 'development' exports to development_resource_packs and development_behavior_packs of specified build type - 'standard', 'edu' or 'preview' - The 'world' exports to the world in specified build path - 'standard', edu' or 'preview' - The vesions before 2.0.0 or unspecified wrok the same as before the update. --- regolith/compatibility_other_os.go | 15 ++++- regolith/compatibility_windows.go | 25 ++++++- regolith/config.go | 8 ++- regolith/errors.go | 16 +++++ regolith/export.go | 101 ++++++++++++++++++++++++----- test/export_windows_test.go | 4 +- 6 files changed, 145 insertions(+), 24 deletions(-) diff --git a/regolith/compatibility_other_os.go b/regolith/compatibility_other_os.go index 7fd9d3da..debe4093 100644 --- a/regolith/compatibility_other_os.go +++ b/regolith/compatibility_other_os.go @@ -5,6 +5,7 @@ package regolith import ( "os" + "github.com/Bedrock-OSS/go-burrito/burrito" ) @@ -50,10 +51,10 @@ func (d *DirWatcher) Close() error { return burrito.WrappedError(notImplementedOnThisSystemError) } -func FindMojangDir() (string, error) { +func FindStandardMojangDir() (string, error) { comMojang := os.Getenv("COM_MOJANG") if comMojang == "" { - return "", burrito.WrappedError(comMojangEnvUnsetError) + return "", burrito.WrappedError(comMojangEnvUnsetError) } return comMojang, nil } @@ -61,11 +62,19 @@ func FindMojangDir() (string, error) { func FindPreviewDir() (string, error) { comMojangPreview := os.Getenv("COM_MOJANG_PREVIEW") if comMojangPreview == "" { - return "", burrito.WrappedError(comMojangPreviewEnvUnsetError) + return "", burrito.WrappedError(comMojangPreviewEnvUnsetError) } return comMojangPreview, nil } +func FindEduDir() (string, error) { + comMojangEdu := os.Getenv("COM_MOJANG_EDU") + if comMojangEdu == "" { + return "", burrito.WrappedError(comMojangEduEnvUnsetError) + } + return comMojangEdu, nil +} + func CheckSuspiciousLocation() error { return nil } diff --git a/regolith/compatibility_windows.go b/regolith/compatibility_windows.go index b0a251e2..9ddb5b9e 100644 --- a/regolith/compatibility_windows.go +++ b/regolith/compatibility_windows.go @@ -146,8 +146,9 @@ func (d *DirWatcher) Close() error { return windows.CloseHandle(d.handle) } -// FindMojangDir returns path to the com.mojang folder. -func FindMojangDir() (string, error) { +// FindStandardMojangDir returns path to the com.mojang folder in the standard +// Minecraft build. +func FindStandardMojangDir() (string, error) { result := filepath.Join( os.Getenv("LOCALAPPDATA"), "Packages", "Microsoft.MinecraftUWP_8wekyb3d8bbwe", "LocalState", "games", @@ -161,6 +162,8 @@ func FindMojangDir() (string, error) { return result, nil } +// FindPreviewDir returns path to the com.mojang folder in the preview +// Minecraft build. func FindPreviewDir() (string, error) { result := filepath.Join( os.Getenv("LOCALAPPDATA"), "Packages", @@ -176,13 +179,29 @@ func FindPreviewDir() (string, error) { return result, nil } +// FindEduDir returns path to the com.mojang folder in the education +// edition Minecraft build. +func FindEduDir() (string, error) { + result := filepath.Join( + os.Getenv("APPDATA"), "Minecraft Education Edition", "games", + "com.mojang") + if _, err := os.Stat(result); err != nil { + if os.IsNotExist(err) { + return "", burrito.WrapErrorf(err, osStatErrorIsNotExist, result) + } + return "", burrito.WrapErrorf( + err, osStatErrorAny, result) + } + return result, nil +} + func CheckSuspiciousLocation() error { path, err := os.Getwd() if err != nil { return burrito.WrapErrorf(err, osGetwdError) } // Check if project directory is within mojang dir - dir, err := FindMojangDir() + dir, err := FindStandardMojangDir() if err == nil { dir1 := filepath.Join(dir, "development_behavior_packs") if isPathWithinDirectory(path, dir1) { diff --git a/regolith/config.go b/regolith/config.go index 2da2abef..8754c8be 100644 --- a/regolith/config.go +++ b/regolith/config.go @@ -29,7 +29,8 @@ type ExportTarget struct { BpName string `json:"bpName,omitempty"` WorldName string `json:"worldName,omitempty"` WorldPath string `json:"worldPath,omitempty"` - ReadOnly bool `json:"readOnly"` // Whether the exported files should be read-only + ReadOnly bool `json:"readOnly"` // Whether the exported files should be read-only + Build string `json:"build,omitempty"` // The type of Minecraft build for the 'develop' } // Packs is a part of "config.json" that points to the source behavior and @@ -115,7 +116,7 @@ func RegolithProjectFromObject( } // FormatVersion if version, ok := obj["formatVersion"]; !ok { - Logger.Warnf("Format version is missing. Defaulting to 1.0.0") + Logger.Warn("Format version is missing. Defaulting to 1.0.0") result.FormatVersion = "1.0.0" } else { formatVersion, ok := version.(string) @@ -229,5 +230,8 @@ func ExportTargetFromObject(obj map[string]interface{}) (ExportTarget, error) { // ReadOnly - can be empty readOnly, _ := obj["readOnly"].(bool) result.ReadOnly = readOnly + // Build - can be empty + build, _ := obj["build"].(string) + result.Build = build return result, nil } diff --git a/regolith/errors.go b/regolith/errors.go index 6f954b5a..a08d9f8a 100644 --- a/regolith/errors.go +++ b/regolith/errors.go @@ -149,6 +149,9 @@ const ( // Error used when env variable COM_MOJANG_PREVIEW is not set on non Windows system comMojangPreviewEnvUnsetError = "COM_MOJANG_PREVIEW environment variable is not set." + // Error used when env variable COM_MOJANG_EDU is not set on non Windows system + comMojangEduEnvUnsetError = "COM_MOJANG_EDU environment variable is not set." + // Error used when SetupTmpFiles function fails setupTmpFilesError = "Failed to setup temporary files.\n" + "Regolith files path: %s" // .regolith @@ -222,4 +225,17 @@ const ( resolverResolveUrlError = "Failed to resolve the URL of the resolver file for the download.\n" + "Short URL: %s" + + // findMojangDirError is used when the FindMojangDir function fails + findMojangDirError = "Failed to find \"com.mojang\" directory." + + // findPreviewDirError is used when the FindPreviewDir function fails + findPreviewDirError = "Failed to find the preview \"com.mojang\" directory." + + // findEduDirError is used when the FindEduDir function fails + findEduDirError = "Failed to find the \"com.mojang\" directory." + + invalidExportPathError = "The build property of the export is invalid:\n" + + "Current value: %q\n" + + "Valid values are: %s" ) diff --git a/regolith/export.go b/regolith/export.go index 593f0d61..356b53d8 100644 --- a/regolith/export.go +++ b/regolith/export.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/Bedrock-OSS/go-burrito/burrito" + "golang.org/x/mod/semver" ) // GetExportPaths returns file paths for exporting behavior pack and @@ -15,24 +16,65 @@ func GetExportPaths( exportTarget ExportTarget, ctx RunContext, ) (bpPath string, rpPath string, err error) { bpName, rpName, err := GetExportNames(exportTarget, ctx) + if err != nil { + return "", "", burrito.WrapError( + err, "Failed to get the export names.") + } + if semver.Compare(ctx.Config.FormatVersion, "v2.0.0") < 0 { + bpPath, rpPath, err = getExportPathsV1_0_0( + exportTarget, bpName, rpName) + } else { + bpPath, rpPath, err = getExportPathsV2_0_0( + exportTarget, bpName, rpName) + } + return +} + +func FindMojangDir(build string) (string, error) { + if build == "standard" { + return FindStandardMojangDir() + } else if build == "preview" { + return FindPreviewDir() + } else if build == "edu" { + return FindEduDir() + // WARNING: If for some reason we will expand this in the future to + // match a new format version, we need to split this into versioned + // functions. + } else { + return "", burrito.WrappedErrorf( + invalidExportPathError, + // current value; valid values + build, "standard, preview, edu") + } +} + +// getExportPathsV1_0_0 handles GetExportPaths for Regolith format versions +// below 2.0.0. +func getExportPathsV1_0_0( + exportTarget ExportTarget, bpName string, rpName string, +) (bpPath string, rpPath string, err error) { if exportTarget.Target == "development" { - comMojang, err := FindMojangDir() + comMojang, err := FindStandardMojangDir() if err != nil { return "", "", burrito.WrapError( - err, "Failed to find \"com.mojang\" directory.") + err, findMojangDirError) } return GetDevelopmentExportPaths(bpName, rpName, comMojang) } else if exportTarget.Target == "preview" { comMojang, err := FindPreviewDir() if err != nil { return "", "", burrito.WrapError( - err, "Failed to find preview \"com.mojang\" directory.") + err, findPreviewDirError) } return GetDevelopmentExportPaths(bpName, rpName, comMojang) } else if exportTarget.Target == "exact" { return GetExactExportPaths(exportTarget) } else if exportTarget.Target == "world" { - return GetWorldExportPaths(exportTarget, bpName, rpName) + return GetWorldExportPaths( + exportTarget.WorldPath, + exportTarget.WorldName, + "standard", + bpName, rpName) } else if exportTarget.Target == "local" { bpPath = "build/" + bpName + "/" rpPath = "build/" + rpName + "/" @@ -46,12 +88,39 @@ func GetExportPaths( return } -func GetDevelopmentExportPaths(bpName, rpName, comMojang string) (bpPath string, rpPath string, err error) { - if err != nil { - return "", "", burrito.WrapError( - err, "Failed to find \"com.mojang\" directory.") +// getExportPathsV2_0_0 handles GetExportPaths for Regolith format version +// 2.0.0. +func getExportPathsV2_0_0( + exportTarget ExportTarget, bpName string, rpName string, +) (bpPath string, rpPath string, err error) { + if exportTarget.Target == "development" { + comMojang, err := FindMojangDir(exportTarget.Build) + if err != nil { + return "", "", burrito.PassError(err) + } + return GetDevelopmentExportPaths(bpName, rpName, comMojang) + } else if exportTarget.Target == "world" { + return GetWorldExportPaths( + exportTarget.WorldPath, + exportTarget.WorldName, + exportTarget.Build, + bpName, rpName) + } else if exportTarget.Target == "exact" { + return GetExactExportPaths(exportTarget) + } else if exportTarget.Target == "local" { + bpPath = "build/" + bpName + "/" + rpPath = "build/" + rpName + "/" + } else if exportTarget.Target == "none" { + bpPath = "" + rpPath = "" + } else { + err = burrito.WrappedErrorf( + "Export target %q is not valid", exportTarget.Target) } + return +} +func GetDevelopmentExportPaths(bpName, rpName, comMojang string) (bpPath string, rpPath string, err error) { bpPath = comMojang + "/development_behavior_packs/" + bpName rpPath = comMojang + "/development_resource_packs/" + rpName return @@ -71,14 +140,16 @@ func GetExactExportPaths(exportTarget ExportTarget) (bpPath string, rpPath strin return } -func GetWorldExportPaths(exportTarget ExportTarget, bpName, rpName string) (bpPath string, rpPath string, err error) { - if exportTarget.WorldPath != "" { - if exportTarget.WorldName != "" { +func GetWorldExportPaths( + worldPath, worldName, build, bpName, rpName string, +) (bpPath string, rpPath string, err error) { + if worldPath != "" { + if worldName != "" { return "", "", burrito.WrappedError( "Using both \"worldName\" and \"worldPath\" is not" + " allowed.") } - wPath, err := ResolvePath(exportTarget.WorldPath) + wPath, err := ResolvePath(worldPath) if err != nil { return "", "", burrito.WrapError( err, "Failed to resolve world path.") @@ -87,8 +158,8 @@ func GetWorldExportPaths(exportTarget ExportTarget, bpName, rpName string) (bpPa wPath, "behavior_packs", bpName) rpPath = filepath.Join( wPath, "resource_packs", rpName) - } else if exportTarget.WorldName != "" { - dir, err := FindMojangDir() + } else if worldName != "" { + dir, err := FindMojangDir(build) if err != nil { return "", "", burrito.WrapError( err, "Failed to find \"com.mojang\" directory.") @@ -98,7 +169,7 @@ func GetWorldExportPaths(exportTarget ExportTarget, bpName, rpName string) (bpPa return "", "", burrito.WrapError(err, "Failed to list worlds.") } for _, world := range worlds { - if world.Name == exportTarget.WorldName { + if world.Name == worldName { bpPath = filepath.Join( world.Path, "behavior_packs", bpName) rpPath = filepath.Join( diff --git a/test/export_windows_test.go b/test/export_windows_test.go index d8238036..b4a31fc7 100644 --- a/test/export_windows_test.go +++ b/test/export_windows_test.go @@ -23,6 +23,8 @@ func TestMoveFilesAcl(t *testing.T) { if os.Getenv("CI") != "" { t.Skip("Skipping test on local machine") } + regolith.InitLogging(true) + // Switch to current working directory at the end of the test defer os.Chdir(getWdOrFatal(t)) @@ -33,7 +35,7 @@ func TestMoveFilesAcl(t *testing.T) { // Find path to com.mojang t.Log("Finding the path to com.mojang...") - mojangDir, err := regolith.FindMojangDir() + mojangDir, err := regolith.FindStandardMojangDir() if err != nil { t.Fatal(err.Error()) } From 3f3b3ae95ecfb1fe2a3d5b5d61b14e8f2f866c2a Mon Sep 17 00:00:00 2001 From: Nusiq Date: Tue, 20 Aug 2024 15:13:31 +0200 Subject: [PATCH 3/8] Changed the default formatVersion to 1.2.0 (to match the newest version of the schema before this update) and renamed the current formatVersion to 1.4.0 (from 2.0.0, to match the next regolith release version). --- regolith/config.go | 6 +++--- regolith/export.go | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/regolith/config.go b/regolith/config.go index 8754c8be..c69a7eae 100644 --- a/regolith/config.go +++ b/regolith/config.go @@ -116,8 +116,8 @@ func RegolithProjectFromObject( } // FormatVersion if version, ok := obj["formatVersion"]; !ok { - Logger.Warn("Format version is missing. Defaulting to 1.0.0") - result.FormatVersion = "1.0.0" + Logger.Warn("Format version is missing. Defaulting to 1.2.0") + result.FormatVersion = "1.2.0" } else { formatVersion, ok := version.(string) if !ok { @@ -132,7 +132,7 @@ func RegolithProjectFromObject( "be a semver version:\n"+ "Current value: %s", formatVersion) } - const latestCompatibleVersion = "2.0.0" + const latestCompatibleVersion = "1.4.0" if semver.Compare(vFormatVersion, "v"+latestCompatibleVersion) < 0 { return result, burrito.WrappedErrorf( "Incompatible formatVersion: \n"+ diff --git a/regolith/export.go b/regolith/export.go index 356b53d8..843aab98 100644 --- a/regolith/export.go +++ b/regolith/export.go @@ -20,11 +20,11 @@ func GetExportPaths( return "", "", burrito.WrapError( err, "Failed to get the export names.") } - if semver.Compare(ctx.Config.FormatVersion, "v2.0.0") < 0 { - bpPath, rpPath, err = getExportPathsV1_0_0( + if semver.Compare(ctx.Config.FormatVersion, "v1.4.0") < 0 { + bpPath, rpPath, err = getExportPathsV1_2_0( exportTarget, bpName, rpName) } else { - bpPath, rpPath, err = getExportPathsV2_0_0( + bpPath, rpPath, err = getExportPathsV1_4_0( exportTarget, bpName, rpName) } return @@ -48,9 +48,9 @@ func FindMojangDir(build string) (string, error) { } } -// getExportPathsV1_0_0 handles GetExportPaths for Regolith format versions -// below 2.0.0. -func getExportPathsV1_0_0( +// getExportPathsV1_2_0 handles GetExportPaths for Regolith format versions +// below 1.4.0. +func getExportPathsV1_2_0( exportTarget ExportTarget, bpName string, rpName string, ) (bpPath string, rpPath string, err error) { if exportTarget.Target == "development" { @@ -88,9 +88,9 @@ func getExportPathsV1_0_0( return } -// getExportPathsV2_0_0 handles GetExportPaths for Regolith format version -// 2.0.0. -func getExportPathsV2_0_0( +// getExportPathsV1_4_0 handles GetExportPaths for Regolith format version +// 1.4.0. +func getExportPathsV1_4_0( exportTarget ExportTarget, bpName string, rpName string, ) (bpPath string, rpPath string, err error) { if exportTarget.Target == "development" { From 58d7f04e4bbb392e27bd65729cf8df166b054618 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Tue, 20 Aug 2024 15:48:24 +0200 Subject: [PATCH 4/8] Renamed all references to education edition from edu to education. --- regolith/compatibility_other_os.go | 2 +- regolith/compatibility_windows.go | 4 ++-- regolith/errors.go | 4 ++-- regolith/export.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/regolith/compatibility_other_os.go b/regolith/compatibility_other_os.go index debe4093..a7d520a0 100644 --- a/regolith/compatibility_other_os.go +++ b/regolith/compatibility_other_os.go @@ -67,7 +67,7 @@ func FindPreviewDir() (string, error) { return comMojangPreview, nil } -func FindEduDir() (string, error) { +func FindEducationDir() (string, error) { comMojangEdu := os.Getenv("COM_MOJANG_EDU") if comMojangEdu == "" { return "", burrito.WrappedError(comMojangEduEnvUnsetError) diff --git a/regolith/compatibility_windows.go b/regolith/compatibility_windows.go index 9ddb5b9e..5ac179cf 100644 --- a/regolith/compatibility_windows.go +++ b/regolith/compatibility_windows.go @@ -179,9 +179,9 @@ func FindPreviewDir() (string, error) { return result, nil } -// FindEduDir returns path to the com.mojang folder in the education +// FindEducationDir returns path to the com.mojang folder in the education // edition Minecraft build. -func FindEduDir() (string, error) { +func FindEducationDir() (string, error) { result := filepath.Join( os.Getenv("APPDATA"), "Minecraft Education Edition", "games", "com.mojang") diff --git a/regolith/errors.go b/regolith/errors.go index a08d9f8a..a7b6a8af 100644 --- a/regolith/errors.go +++ b/regolith/errors.go @@ -232,8 +232,8 @@ const ( // findPreviewDirError is used when the FindPreviewDir function fails findPreviewDirError = "Failed to find the preview \"com.mojang\" directory." - // findEduDirError is used when the FindEduDir function fails - findEduDirError = "Failed to find the \"com.mojang\" directory." + // findEducationDirError is used when the FindEducationDir function fails + findEducationDirError = "Failed to find the \"com.mojang\" directory." invalidExportPathError = "The build property of the export is invalid:\n" + "Current value: %q\n" + diff --git a/regolith/export.go b/regolith/export.go index 843aab98..0351576a 100644 --- a/regolith/export.go +++ b/regolith/export.go @@ -35,8 +35,8 @@ func FindMojangDir(build string) (string, error) { return FindStandardMojangDir() } else if build == "preview" { return FindPreviewDir() - } else if build == "edu" { - return FindEduDir() + } else if build == "education" { + return FindEducationDir() // WARNING: If for some reason we will expand this in the future to // match a new format version, we need to split this into versioned // functions. @@ -44,7 +44,7 @@ func FindMojangDir(build string) (string, error) { return "", burrito.WrappedErrorf( invalidExportPathError, // current value; valid values - build, "standard, preview, edu") + build, "standard, preview, education") } } From 56fce1bfc6fe13ad5d11855b5a8458dd0b393ec4 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Tue, 20 Aug 2024 16:41:32 +0200 Subject: [PATCH 5/8] Config format version detection fixes: - Regolith correctly supports only the versions lower than the latestSuportedVersion (not the higher versions) - Updated test files - Changed the schema used by config files generated by 'regolith init' to use version 1.4 --- regolith/config.go | 11 +++++------ regolith/errors.go | 6 ++++++ regolith/export.go | 10 ++++++++-- regolith/main_functions.go | 3 ++- test/testdata/fresh_project/config.json | 3 ++- test/testdata/regolith_install/1.0.0/config.json | 3 ++- test/testdata/regolith_install/1.0.1/config.json | 3 ++- test/testdata/regolith_install/HEAD/config.json | 3 ++- test/testdata/regolith_install/latest/config.json | 3 ++- test/testdata/regolith_install/sha/config.json | 3 ++- test/testdata/regolith_install/tag/config.json | 3 ++- 11 files changed, 35 insertions(+), 16 deletions(-) diff --git a/regolith/config.go b/regolith/config.go index c69a7eae..095b376c 100644 --- a/regolith/config.go +++ b/regolith/config.go @@ -5,6 +5,8 @@ import ( "golang.org/x/mod/semver" ) +const latestCompatibleVersion = "1.4.0" + const StandardLibraryUrl = "github.com/Bedrock-OSS/regolith-filters" const ConfigFilePath = "config.json" const GitIgnore = "/build\n/.regolith" @@ -126,18 +128,15 @@ func RegolithProjectFromObject( } result.FormatVersion = formatVersion vFormatVersion := "v" + formatVersion - if semver.IsValid("v" + formatVersion) { + if !semver.IsValid("v" + formatVersion) { return result, burrito.WrappedErrorf( "Invalid value of formatVersion. The formatVersion must "+ "be a semver version:\n"+ "Current value: %s", formatVersion) } - const latestCompatibleVersion = "1.4.0" - if semver.Compare(vFormatVersion, "v"+latestCompatibleVersion) < 0 { + if semver.Compare(vFormatVersion, "v"+latestCompatibleVersion) > 0 { return result, burrito.WrappedErrorf( - "Incompatible formatVersion: \n"+ - "Current version: %s\n"+ - "Latest compatible version: %s\n", + incompatibleFormatVersionError, formatVersion, latestCompatibleVersion) } } diff --git a/regolith/errors.go b/regolith/errors.go index a7b6a8af..b909689b 100644 --- a/regolith/errors.go +++ b/regolith/errors.go @@ -238,4 +238,10 @@ const ( invalidExportPathError = "The build property of the export is invalid:\n" + "Current value: %q\n" + "Valid values are: %s" + + // Error used when the formatVersion of the config file is incompatible + // with the current version of Regolith. + incompatibleFormatVersionError = "Incompatible formatVersion: \n" + + "Version in config: %s\n" + + "Latest compatible version: %s" ) diff --git a/regolith/export.go b/regolith/export.go index 0351576a..a4919bac 100644 --- a/regolith/export.go +++ b/regolith/export.go @@ -20,12 +20,18 @@ func GetExportPaths( return "", "", burrito.WrapError( err, "Failed to get the export names.") } - if semver.Compare(ctx.Config.FormatVersion, "v1.4.0") < 0 { + vFormatVersion := "v" + ctx.Config.FormatVersion + + if semver.Compare(vFormatVersion, "v1.4.0") < 0 { bpPath, rpPath, err = getExportPathsV1_2_0( exportTarget, bpName, rpName) - } else { + } else if semver.Compare(vFormatVersion, "v1.4.0") == 0 { bpPath, rpPath, err = getExportPathsV1_4_0( exportTarget, bpName, rpName) + } else { + err = burrito.WrappedErrorf( + incompatibleFormatVersionError, + ctx.Config.FormatVersion, latestCompatibleVersion) } return } diff --git a/regolith/main_functions.go b/regolith/main_functions.go index 0e43d9db..6b4303b0 100644 --- a/regolith/main_functions.go +++ b/regolith/main_functions.go @@ -449,6 +449,7 @@ func Init(debug, force bool) error { ResourceFolder: "./packs/RP", }, RegolithProject: RegolithProject{ + FormatVersion: "1.4.0", DataPath: "./packs/data", FilterDefinitions: map[string]FilterInstaller{}, Profiles: map[string]Profile{ @@ -468,7 +469,7 @@ func Init(debug, force bool) error { // Add the schema property, this is a little hacky rawJsonData := make(map[string]interface{}, 0) json.Unmarshal(jsonBytes, &rawJsonData) - rawJsonData["$schema"] = "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json" + rawJsonData["$schema"] = "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json" jsonBytes, _ = json.MarshalIndent(rawJsonData, "", "\t") err = os.WriteFile(ConfigFilePath, jsonBytes, 0644) diff --git a/test/testdata/fresh_project/config.json b/test/testdata/fresh_project/config.json index 522add5d..af763203 100644 --- a/test/testdata/fresh_project/config.json +++ b/test/testdata/fresh_project/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -9,6 +9,7 @@ "regolith": { "dataPath": "./packs/data", "filterDefinitions": {}, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/1.0.0/config.json b/test/testdata/regolith_install/1.0.0/config.json index 220bb8ae..ba293241 100644 --- a/test/testdata/regolith_install/1.0.0/config.json +++ b/test/testdata/regolith_install/1.0.0/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "1.0.0" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/1.0.1/config.json b/test/testdata/regolith_install/1.0.1/config.json index 82aef93b..1010a0d0 100644 --- a/test/testdata/regolith_install/1.0.1/config.json +++ b/test/testdata/regolith_install/1.0.1/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "1.0.1" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/HEAD/config.json b/test/testdata/regolith_install/HEAD/config.json index 883cc0ce..817adccd 100644 --- a/test/testdata/regolith_install/HEAD/config.json +++ b/test/testdata/regolith_install/HEAD/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "HEAD" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/latest/config.json b/test/testdata/regolith_install/latest/config.json index 2ab3fc35..1afd8e8e 100644 --- a/test/testdata/regolith_install/latest/config.json +++ b/test/testdata/regolith_install/latest/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "latest" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/sha/config.json b/test/testdata/regolith_install/sha/config.json index f0f92b75..edf9a0fb 100644 --- a/test/testdata/regolith_install/sha/config.json +++ b/test/testdata/regolith_install/sha/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "0c129227eb90e2f10a038755e4756fdd47e765e6" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { diff --git a/test/testdata/regolith_install/tag/config.json b/test/testdata/regolith_install/tag/config.json index 260d7c40..ece711ea 100644 --- a/test/testdata/regolith_install/tag/config.json +++ b/test/testdata/regolith_install/tag/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.2.json", + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", "author": "Your name", "name": "Project name", "packs": { @@ -14,6 +14,7 @@ "version": "TEST_TAG_1" } }, + "formatVersion": "1.4.0", "profiles": { "default": { "export": { From 1b930054f0cb1f678779ad0b4dee0ebbf86b8e54 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Wed, 21 Aug 2024 12:15:44 +0200 Subject: [PATCH 6/8] Added windows tests (not for CI) for checking the development export targets exporting files to correct the locations. --- test/common.go | 5 + test/development_export_windows_test.go | 108 ++++++++++++++++++ .../development_export_targets/.gitignore | 2 + .../development_export_targets/config.json | 36 ++++++ .../packs/BP/manifest.json | 23 ++++ .../packs/RP/manifest.json | 17 +++ .../packs/data/example_data_file.json | 1 + 7 files changed, 192 insertions(+) create mode 100644 test/development_export_windows_test.go create mode 100644 test/testdata/development_export_targets/.gitignore create mode 100644 test/testdata/development_export_targets/config.json create mode 100644 test/testdata/development_export_targets/packs/BP/manifest.json create mode 100644 test/testdata/development_export_targets/packs/RP/manifest.json create mode 100644 test/testdata/development_export_targets/packs/data/example_data_file.json diff --git a/test/common.go b/test/common.go index a83b44ff..cf8b4559 100644 --- a/test/common.go +++ b/test/common.go @@ -23,6 +23,11 @@ const ( // in data path. minimalProjectPath = "testdata/minimal_project" + // developmentExportTargets is a minimal project with 3 profiles - + // standard, education and preview. Each profile has different export + // targets. + developmentExportTargets = "testdata/development_export_targets" + // multitarget_project is a copy of minimal_project but with modified // config.json, to add multiple profiles with different export targets. multitargetProjectPath = "testdata/multitarget_project" diff --git a/test/development_export_windows_test.go b/test/development_export_windows_test.go new file mode 100644 index 00000000..38c70a7c --- /dev/null +++ b/test/development_export_windows_test.go @@ -0,0 +1,108 @@ +//go:build windows +// +build windows + +package test + +import ( + "os" + "path/filepath" + "testing" + + "github.com/Bedrock-OSS/regolith/regolith" +) + +// TestCustomDevelopmentExportLocation tests if the development export targets +// work as expected. It tesets the "development" target with the "build" +// property set to "standard" it will fail on a computer without +// Minecraft Bedrock Edition installed. +func TestDevelopmentStandardExportLocation(t *testing.T) { + if os.Getenv("CI") != "" { + t.Skip("Skipping test on local machine") + } + _testCustomDevelopmentExportLocation( + t, regolith.FindStandardMojangDir, "standard", + "TestDevelopmentStandardExportLocation") +} + +// TestDevelopmentEducationExportLocation tests if the development export +// targets work as expected. It tesets the "development" target with the +// "build" property set to "education" it will fail on a computer without +// Minecraft Bedrock Edition installed. +func TestDevelopmentEducationExportLocation(t *testing.T) { + if os.Getenv("CI") != "" { + t.Skip("Skipping test on local machine") + } + _testCustomDevelopmentExportLocation( + t, regolith.FindEducationDir, "education", + "TestDevelopmentEducationExportLocation") +} + +// TestDevelopmentPreviewExportLocation tests if the development export +// targets work as expected. It tesets the "development" target with the +// "build" property set to "preview" it will fail on a computer without +// Minecraft Bedrock Edition Preview installed. +func TestDevelopmentPreviewExportLocation(t *testing.T) { + if os.Getenv("CI") != "" { + t.Skip("Skipping test on local machine") + } + _testCustomDevelopmentExportLocation( + t, regolith.FindPreviewDir, "preview", + "TestDevelopmentPreviewExportLocation") +} + +func _testCustomDevelopmentExportLocation( + t *testing.T, mojangDirGetter func() (string, error), profileToRun string, + workingDirFolderName string, +) { + if os.Getenv("CI") != "" { + t.Skip("Skipping test on local machine") + } + regolith.InitLogging(true) + + // Switch to current working directory at the end of the test + defer os.Chdir(getWdOrFatal(t)) + + // TEST PREPARATION + t.Log("Clearing the testing directory...") + tmpDir := prepareTestDirectory(workingDirFolderName, t) + + t.Log("Copying the project files into the testing directory...") + copyFilesOrFatal(developmentExportTargets, tmpDir, t) + os.Chdir(tmpDir) + + // FIND PATH TO com.mojang + t.Log("Finding the path to com.mojang...") + mojangDir, err := mojangDirGetter() + if err != nil { + t.Fatal(err.Error()) + } + + // LOAD DATA FROM CONFIG + // Get the name of the project from config + t.Log("Loading the data from config, befor running the test...") + configJson, err := regolith.LoadConfigAsMap() + if err != nil { + t.Fatal(err.Error()) + } + config, err := regolith.ConfigFromObject(configJson) + if err != nil { + t.Fatal(err.Error()) + } + bpPath := filepath.Join( + mojangDir, "development_behavior_packs", config.Name+"_bp") + rpPath := filepath.Join( + mojangDir, "development_resource_packs", config.Name+"_rp") + + // THE TEST + t.Log("Testing the 'regolith run' command...") + err = regolith.Run(profileToRun, true) + if err != nil { + t.Fatal("'regolith run' failed:", err) + } + + t.Log("Checking if the RP and BP have been exported...") + assertDirExistsOrFatal(rpPath, t) + defer os.RemoveAll(rpPath) + assertDirExistsOrFatal(bpPath, t) + defer os.RemoveAll(bpPath) +} diff --git a/test/testdata/development_export_targets/.gitignore b/test/testdata/development_export_targets/.gitignore new file mode 100644 index 00000000..3f195ca9 --- /dev/null +++ b/test/testdata/development_export_targets/.gitignore @@ -0,0 +1,2 @@ +/build +/.regolith \ No newline at end of file diff --git a/test/testdata/development_export_targets/config.json b/test/testdata/development_export_targets/config.json new file mode 100644 index 00000000..f1218bca --- /dev/null +++ b/test/testdata/development_export_targets/config.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://raw.githubusercontent.com/Bedrock-OSS/regolith-schemas/main/config/v1.4.json", + "name": "regolith_test_project", + "author": "Bedrock-OSS", + "packs": { + "behaviorPack": "./packs/BP", + "resourcePack": "./packs/RP" + }, + "regolith": { + "formatVersion": "1.4.0", + "profiles": { + "standard": { + "filters": [], + "export": { + "target": "development", + "build": "standard" + } + }, + "education": { + "filters": [], + "export": { + "target": "development", + "build": "education" + } + }, + "preview": { + "filters": [], + "export": { + "target": "development", + "build": "preview" + } + } + }, + "dataPath": "./packs/data" + } +} \ No newline at end of file diff --git a/test/testdata/development_export_targets/packs/BP/manifest.json b/test/testdata/development_export_targets/packs/BP/manifest.json new file mode 100644 index 00000000..d493e864 --- /dev/null +++ b/test/testdata/development_export_targets/packs/BP/manifest.json @@ -0,0 +1,23 @@ +{ + "format_version": 2, + "header": { + "description": "This is test BP", + "name": "Regolith Test BP", + "uuid": "96b53fd2-b7a1-4d26-b74f-1b9394c8d0bc", + "version": [1, 0, 0], + "min_engine_version": [1, 16, 0] + }, + "modules": [ + { + "type": "data", + "uuid": "4eef1f3f-91b5-43df-b5ab-07e9aa89081b", + "version": [1, 0, 0] + } + ], + "dependencies": [ + { + "uuid": "6f6e3f0b-1627-488d-a9aa-2d1430ba368a", + "version": [1, 0, 0] + } + ] +} \ No newline at end of file diff --git a/test/testdata/development_export_targets/packs/RP/manifest.json b/test/testdata/development_export_targets/packs/RP/manifest.json new file mode 100644 index 00000000..3274a66f --- /dev/null +++ b/test/testdata/development_export_targets/packs/RP/manifest.json @@ -0,0 +1,17 @@ +{ + "format_version": 2, + "header": { + "description": "This is test RP", + "name": "Regolith Test RP", + "uuid": "6f6e3f0b-1627-488d-a9aa-2d1430ba368a", + "version": [1, 0, 0], + "min_engine_version": [1, 16, 0] + }, + "modules": [ + { + "type": "resources", + "uuid": "65b1ba69-462d-4199-aa3b-a0f161ed0bde", + "version": [1, 0, 0] + } + ] +} \ No newline at end of file diff --git a/test/testdata/development_export_targets/packs/data/example_data_file.json b/test/testdata/development_export_targets/packs/data/example_data_file.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/test/testdata/development_export_targets/packs/data/example_data_file.json @@ -0,0 +1 @@ +{} \ No newline at end of file From 263bedbf064fb4a8f666f939f9a28166c61615e5 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Wed, 21 Aug 2024 12:27:06 +0200 Subject: [PATCH 7/8] Regolith sets the default export target to 'target': 'development, 'build': 'standard' during 'regolith init'. --- regolith/main_functions.go | 1 + test/testdata/fresh_project/config.json | 1 + test/testdata/regolith_install/1.0.0/config.json | 1 + test/testdata/regolith_install/1.0.1/config.json | 1 + test/testdata/regolith_install/HEAD/config.json | 1 + test/testdata/regolith_install/latest/config.json | 1 + test/testdata/regolith_install/sha/config.json | 1 + test/testdata/regolith_install/tag/config.json | 1 + 8 files changed, 8 insertions(+) diff --git a/regolith/main_functions.go b/regolith/main_functions.go index 6b4303b0..3414be13 100644 --- a/regolith/main_functions.go +++ b/regolith/main_functions.go @@ -459,6 +459,7 @@ func Init(debug, force bool) error { }, ExportTarget: ExportTarget{ Target: "development", + Build: "standard", ReadOnly: false, }, }, diff --git a/test/testdata/fresh_project/config.json b/test/testdata/fresh_project/config.json index af763203..6883dd6e 100644 --- a/test/testdata/fresh_project/config.json +++ b/test/testdata/fresh_project/config.json @@ -13,6 +13,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/1.0.0/config.json b/test/testdata/regolith_install/1.0.0/config.json index ba293241..3bccd486 100644 --- a/test/testdata/regolith_install/1.0.0/config.json +++ b/test/testdata/regolith_install/1.0.0/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/1.0.1/config.json b/test/testdata/regolith_install/1.0.1/config.json index 1010a0d0..612c12be 100644 --- a/test/testdata/regolith_install/1.0.1/config.json +++ b/test/testdata/regolith_install/1.0.1/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/HEAD/config.json b/test/testdata/regolith_install/HEAD/config.json index 817adccd..3a247304 100644 --- a/test/testdata/regolith_install/HEAD/config.json +++ b/test/testdata/regolith_install/HEAD/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/latest/config.json b/test/testdata/regolith_install/latest/config.json index 1afd8e8e..2c964104 100644 --- a/test/testdata/regolith_install/latest/config.json +++ b/test/testdata/regolith_install/latest/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/sha/config.json b/test/testdata/regolith_install/sha/config.json index edf9a0fb..7e22b7bb 100644 --- a/test/testdata/regolith_install/sha/config.json +++ b/test/testdata/regolith_install/sha/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, diff --git a/test/testdata/regolith_install/tag/config.json b/test/testdata/regolith_install/tag/config.json index ece711ea..2cb76d4c 100644 --- a/test/testdata/regolith_install/tag/config.json +++ b/test/testdata/regolith_install/tag/config.json @@ -18,6 +18,7 @@ "profiles": { "default": { "export": { + "build": "standard", "readOnly": false, "target": "development" }, From ca46b52875252a0fe0385950a8f8a6b5a7488888 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Wed, 21 Aug 2024 12:36:01 +0200 Subject: [PATCH 8/8] Updated the documentation. --- docs/docs/guide/configuration.md | 1 + docs/docs/guide/create-a-filter.md | 1 + docs/docs/guide/export-targets.md | 29 ++++++--------------------- docs/docs/guide/getting-started.md | 4 +++- docs/docs/guide/installing-filters.md | 3 ++- docs/docs/guide/profiles.md | 2 ++ 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/docs/docs/guide/configuration.md b/docs/docs/guide/configuration.md index 83651e94..cbbbcef0 100644 --- a/docs/docs/guide/configuration.md +++ b/docs/docs/guide/configuration.md @@ -76,6 +76,7 @@ Example config, with many options explained: // Export target defines where your files will be exported "export": { "target": "development", + "build": "standard", "readOnly": false } } diff --git a/docs/docs/guide/create-a-filter.md b/docs/docs/guide/create-a-filter.md index 7217eb90..f9cd606c 100644 --- a/docs/docs/guide/create-a-filter.md +++ b/docs/docs/guide/create-a-filter.md @@ -48,6 +48,7 @@ At this point, you need to edit your `config.json` so that `giant_mobs` is regis ], "export": { "target": "development", + "build": "standard", "readOnly": true } } diff --git a/docs/docs/guide/export-targets.md b/docs/docs/guide/export-targets.md index 660f3e77..b35f6b89 100644 --- a/docs/docs/guide/export-targets.md +++ b/docs/docs/guide/export-targets.md @@ -29,11 +29,12 @@ These are the export targets that Regolith offers. ## Development -The development export target will place the compiled packs into your `com.mojang` `development_*_packs` folders. +The development export target will place the compiled packs into your `com.mojang` `development_*_packs` folders of the specified Minecraft build (standard, preview or education endition). ```json "export": { - "target": "development" + "target": "development", + "build": "standard" // or "preview" or "education" } ``` @@ -42,6 +43,7 @@ Optionally, you can use `rpName` and `bpName` to specify the names of the folder ```json "export": { "target": "development", + "build": "standard", "rpName": "'my_rp'", "bpName": "'my_bp'" } @@ -91,13 +93,14 @@ The exact export target doesn't support using `rpName` and `bpName`. The `rpPath The World export target will place the compiled files into a specific world. This is useful for teams that prefer working in-world, as opposed to in the development pack folders. -You need to use *either* `worldName` or `worldPath` to select the world. `worldPath` supports environment variables by using the `%VARIABLE_NAME%` syntax. +You need to use *either* `worldName` or `worldPath` to select the world. `worldPath` supports environment variables by using the `%VARIABLE_NAME%` syntax. If you use `worldName`, you have to specify the Minecraft build you're using - `standard`, `preview` or `education`. Example: ```json "export": { "target": "world", + "build": "standard", "worldName": "..." // This // "worldPath": "..." // OR this } @@ -114,26 +117,6 @@ Optionally, you can use `rpName` and `bpName` to specify the names of the folder } ``` - -## Preview - -The development export target will place the compiled packs into your **(minecraft preview)** `com.mojang` `development_*_packs` folder. - -```json -"export": { - "target": "preview" -} -``` - -Optionally, you can use `rpName` and `bpName` to specify the names of the folders that will be created in the `development_*_packs` folders. You can read more about these options at the end of this page of the documentation. -```json -"export": { - "target": "preview", - "rpName": "'my_rp'", - "bpName": "'my_bp'" -} -``` - # The `rpName` and `bpName` expressions The `rpName` and `bpName` are expressions evaulated using the [go-simple-eval](https://github.com/stirante/go-simple-eval/) library. They let you specify the names of the folders of the exported packs in some of the export targets. diff --git a/docs/docs/guide/getting-started.md b/docs/docs/guide/getting-started.md index 32f99357..5f723077 100644 --- a/docs/docs/guide/getting-started.md +++ b/docs/docs/guide/getting-started.md @@ -51,6 +51,7 @@ Next, open up `config.json`. We will be configuring a few fields here, for your "filters": [], "export": { "target": "development", + "build": "standard", "readOnly": false } } @@ -115,7 +116,8 @@ You should adjust the default profile in `config.json` to look like this: "default": { "export": { "readOnly": false, - "target": "development" + "target": "development", + "build": "standard" }, "filters": [ { diff --git a/docs/docs/guide/installing-filters.md b/docs/docs/guide/installing-filters.md index 4a6535c5..b6afe958 100644 --- a/docs/docs/guide/installing-filters.md +++ b/docs/docs/guide/installing-filters.md @@ -49,7 +49,8 @@ After installing, the filter will appear inside of `filter_definitions` of `conf "default": { "export": { "readOnly": false, - "target": "development" + "target": "development", + "build": "standard" }, "filters": [ { diff --git a/docs/docs/guide/profiles.md b/docs/docs/guide/profiles.md index e5ba0e82..85cc5414 100644 --- a/docs/docs/guide/profiles.md +++ b/docs/docs/guide/profiles.md @@ -40,6 +40,7 @@ Here is an example `config.json` with a second profile called `package`. ], "export": { "target": "development", + "build": "standard" } }, @@ -50,6 +51,7 @@ Here is an example `config.json` with a second profile called `package`. ], "export": { "target": "development", + "build": "standard" } } },