Skip to content

Commit 916e795

Browse files
committed
Simplified archiveCompiledFiles function signature
It doesn't make sense anymore to keep path and filename separated.
1 parent 06e3e7f commit 916e795

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

internal/arduino/builder/archive_compiled_files.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ import (
2020
)
2121

2222
// ArchiveCompiledFiles fixdoc
23-
func (b *Builder) archiveCompiledFiles(buildPath *paths.Path, archiveFile *paths.Path, objectFilesToArchive paths.PathList) (*paths.Path, error) {
24-
archiveFilePath := buildPath.JoinPath(archiveFile)
25-
23+
func (b *Builder) archiveCompiledFiles(archiveFilePath *paths.Path, objectFilesToArchive paths.PathList) (*paths.Path, error) {
2624
if b.onlyUpdateCompilationDatabase {
2725
if b.logger.Verbose() {
2826
b.logger.Info(tr("Skipping archive creation of: %[1]s", archiveFilePath))

internal/arduino/builder/core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (b *Builder) compileCore() (*paths.Path, paths.PathList, error) {
128128
return nil, nil, err
129129
}
130130

131-
archiveFile, err := b.archiveCompiledFiles(b.coreBuildPath, paths.New("core.a"), coreObjectFiles)
131+
archiveFile, err := b.archiveCompiledFiles(b.coreBuildPath.Join("core.a"), coreObjectFiles)
132132
if err != nil {
133133
return nil, nil, err
134134
}

internal/arduino/builder/libraries.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (b *Builder) compileLibrary(library *libraries.Library, includes []string)
196196
return nil, err
197197
}
198198
if library.DotALinkage {
199-
archiveFile, err := b.archiveCompiledFiles(libraryBuildPath, paths.New(library.DirName+".a"), libObjectFiles)
199+
archiveFile, err := b.archiveCompiledFiles(libraryBuildPath.Join(library.DirName+".a"), libObjectFiles)
200200
if err != nil {
201201
return nil, err
202202
}

internal/arduino/builder/linker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (b *Builder) link() error {
7171
// extract all the object files that are in the same directory of the archive
7272
return object.Parent().EquivalentTo(archiveDir)
7373
})
74-
b.archiveCompiledFiles(archive.Parent(), paths.New(archive.Base()), relatedObjectFiles)
74+
b.archiveCompiledFiles(archive, relatedObjectFiles)
7575
}
7676

7777
// Put everything together

0 commit comments

Comments
 (0)