chore: rename ArchiveSrcDir

This commit is contained in:
Haolan
2025-09-10 11:47:02 +08:00
parent 8ce6c3b9ab
commit 073e79d03b
7 changed files with 24 additions and 24 deletions

View File

@@ -104,10 +104,10 @@ type CompileConfig struct {
}
type LibConfig struct {
Url string
Name string // Library name (e.g., "picolibc", "musl", "glibc")
Version string
ArchiveSrcDir string
Url string
Name string // Library name (e.g., "picolibc", "musl", "glibc")
Version string
ResourceSubDir string
}
// String returns a string representation of the library configuration

View File

@@ -26,8 +26,8 @@ func TestGetNewlibESP32Config_LibConfig(t *testing.T) {
}
expectedArchiveSrcDir := "newlib-esp-4.3.0_20250211-patch3"
if config.ArchiveSrcDir != expectedArchiveSrcDir {
t.Errorf("Expected ArchiveSrcDir '%s', got '%s'", expectedArchiveSrcDir, config.ArchiveSrcDir)
if config.ResourceSubDir != expectedArchiveSrcDir {
t.Errorf("Expected ResourceSubDir '%s', got '%s'", expectedArchiveSrcDir, config.ResourceSubDir)
}
// Test String() method
@@ -57,8 +57,8 @@ func TestGetPicolibcConfig_LibConfig(t *testing.T) {
}
expectedArchiveSrcDir := "picolibc-main"
if config.ArchiveSrcDir != expectedArchiveSrcDir {
t.Errorf("Expected ArchiveSrcDir '%s', got '%s'", expectedArchiveSrcDir, config.ArchiveSrcDir)
if config.ResourceSubDir != expectedArchiveSrcDir {
t.Errorf("Expected ResourceSubDir '%s', got '%s'", expectedArchiveSrcDir, config.ResourceSubDir)
}
// Test String() method

View File

@@ -29,10 +29,10 @@ func withDefaultCCFlags(ccflags []string) []string {
// GetNewlibESP32Config returns the configuration for downloading and building newlib for ESP32
func GetNewlibESP32Config() compile.LibConfig {
return compile.LibConfig{
Url: "https://github.com/goplus/newlib/archive/refs/tags/esp-4.3.0_20250211-patch3.tar.gz",
Name: "newlib-esp32",
Version: "esp-4.3.0_20250211-patch3",
ArchiveSrcDir: "newlib-esp-4.3.0_20250211-patch3",
Url: "https://github.com/goplus/newlib/archive/refs/tags/esp-4.3.0_20250211-patch3.tar.gz",
Name: "newlib-esp32",
Version: "esp-4.3.0_20250211-patch3",
ResourceSubDir: "newlib-esp-4.3.0_20250211-patch3",
}
}

View File

@@ -10,10 +10,10 @@ import (
// GetPicolibcConfig returns the configuration for downloading and building picolibc
func GetPicolibcConfig() compile.LibConfig {
return compile.LibConfig{
Name: "picolibc",
Version: "v0.1.0",
Url: "https://github.com/goplus/picolibc/archive/refs/heads/main.zip",
ArchiveSrcDir: "picolibc-main",
Name: "picolibc",
Version: "v0.1.0",
Url: "https://github.com/goplus/picolibc/archive/refs/heads/main.zip",
ResourceSubDir: "picolibc-main",
}
}

View File

@@ -102,10 +102,10 @@ func withPlatformSpecifiedFiles(baseDir, target string, files []string) []string
func GetCompilerRTConfig() compile.LibConfig {
return compile.LibConfig{
Name: "compiler-rt",
Url: "https://github.com/goplus/compiler-rt/archive/refs/tags/xtensa_release_19.1.2.tar.gz",
Version: "xtensa_release_19.1.2",
ArchiveSrcDir: "compiler-rt-xtensa_release_19.1.2",
Name: "compiler-rt",
Url: "https://github.com/goplus/compiler-rt/archive/refs/tags/xtensa_release_19.1.2.tar.gz",
Version: "xtensa_release_19.1.2",
ResourceSubDir: "compiler-rt-xtensa_release_19.1.2",
}
}

View File

@@ -25,8 +25,8 @@ func TestGetCompilerRTConfig_LibConfig(t *testing.T) {
}
expectedArchiveSrcDir := "compiler-rt-xtensa_release_19.1.2"
if config.ArchiveSrcDir != expectedArchiveSrcDir {
t.Errorf("Expected ArchiveSrcDir '%s', got '%s'", expectedArchiveSrcDir, config.ArchiveSrcDir)
if config.ResourceSubDir != expectedArchiveSrcDir {
t.Errorf("Expected ResourceSubDir '%s', got '%s'", expectedArchiveSrcDir, config.ResourceSubDir)
}
// Test String() method

View File

@@ -40,7 +40,7 @@ func getLibcCompileConfigByName(baseDir, libcName, target, mcpu string) (outputD
return libcDir, compileConfig, err
}
if err = checkDownloadAndExtractLib(config.Url, libcDir, config.ArchiveSrcDir); err != nil {
if err = checkDownloadAndExtractLib(config.Url, libcDir, config.ResourceSubDir); err != nil {
return
}
@@ -70,7 +70,7 @@ func getRTCompileConfigByName(baseDir, rtName, target string) (outputDir string,
return rtDir, compileConfig, err
}
if err = checkDownloadAndExtractLib(config.Url, rtDir, config.ArchiveSrcDir); err != nil {
if err = checkDownloadAndExtractLib(config.Url, rtDir, config.ResourceSubDir); err != nil {
return
}