removed need for '-p' flag

This commit is contained in:
partisan 2024-12-21 22:02:29 +01:00
parent 993bf58ecd
commit bc8a62666b
2 changed files with 25 additions and 6 deletions

View file

@ -37,15 +37,21 @@ Below is a detailed description of all the flags supported by the Spitfire Build
### **Build Process Flags**
- **`-a`**:
Perform all steps of the build process, including cleaning, updating the repository, building, and applying patches.
Perform all steps of the build process, including cleaning, updating the repository, building, and applying patches. (Without uploading)
- **`-b`**:
Compiles the source code without cleaning or updating.
- **`--clean`**:
Cleans the build directory by removing temporary or cached files.
- **`--full-clean`**:
Performs a full clean by removing all build artifacts (clobber).
- **`-u`**:
Updates the Mozilla source repository to the latest revision using Mercurial (`hg pull`).
- **`--patches`**:
Applies custom patches to the source code.
- **`--pre-patch`**:
Applies pre-build patches to the source code.
- **`--post-patch`**:
Applies post-build patches to the built output.
- **`--skip-patch-update`**:
Skips updating the patches repository.
- **`-r`**:
Runs the built project after the build process completes successfully.
@ -61,7 +67,7 @@ Below is a detailed description of all the flags supported by the Spitfire Build
### **Customization Flags**
- **`-p=<path>`**:
Specifies the build directory path. If not provided, the default path is used.
Specifies the build directory path for uploads. If not provided, the script dynamically detects the build directory.
- **`-t=<target>`**:
Sets the target format for the build output. The format follows `component-arch-release-platform`.
- **`-v=<version>`**:

17
main.go
View file

@ -130,8 +130,21 @@ func main() {
}
fmt.Printf("Initial working directory: %s\n", initialDir)
// Convert buildPath and uploadPath to absolute paths
if buildPath != "" {
// Determine buildPath dynamically if not provided
if buildPath == "" {
sourcePath, err := spitfire.ResolvePath("./mozilla-central")
if err != nil {
log.Fatalf("Error resolving source path: %v", err)
}
resolvedBuildPath, err := spitfire.ResolveBuildDir(sourcePath)
if err != nil {
log.Fatalf("Failed to detect build directory dynamically: %v", err)
}
buildPath = resolvedBuildPath
fmt.Printf("Automatically detected buildPath: %s\n", buildPath)
} else {
// Convert buildPath to absolute path
buildPath, err2 = spitfire.ResolvePath(buildPath)
if err2 != nil {
log.Fatalf("Failed to convert buildPath to absolute path: %v", err2)