mynewt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccoll...@apache.org
Subject incubator-mynewt-newt git commit: MYNEWT-507 newt - Include full path in .a files
Date Sat, 10 Dec 2016 17:10:56 GMT
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 60de31af7 -> e7f31c7e0


MYNEWT-507 newt - Include full path in .a files


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/e7f31c7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/e7f31c7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/e7f31c7e

Branch: refs/heads/develop
Commit: e7f31c7e0a9bff4f1e88a6df7f8ca3edd3e81b90
Parents: 60de31a
Author: Christopher Collins <ccollins@apache.org>
Authored: Sat Dec 10 08:59:47 2016 -0800
Committer: Christopher Collins <ccollins@apache.org>
Committed: Sat Dec 10 08:59:47 2016 -0800

----------------------------------------------------------------------
 newt/builder/paths.go                           | 11 ++++++++++-
 newt/vendor/mynewt.apache.org/newt/util/util.go |  9 +++++++++
 util/util.go                                    |  9 +++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e7f31c7e/newt/builder/paths.go
----------------------------------------------------------------------
diff --git a/newt/builder/paths.go b/newt/builder/paths.go
index 0307099..1f68220 100644
--- a/newt/builder/paths.go
+++ b/newt/builder/paths.go
@@ -25,6 +25,7 @@ import (
 	"mynewt.apache.org/newt/newt/interfaces"
 	"mynewt.apache.org/newt/newt/pkg"
 	"mynewt.apache.org/newt/newt/project"
+	"mynewt.apache.org/newt/util"
 )
 
 const BUILD_NAME_APP = "app"
@@ -77,6 +78,13 @@ func PkgBinDir(targetName string, buildName string, pkgName string,
 	}
 }
 
+func ArchivePath(targetName string, buildName string, pkgName string,
+	pkgType interfaces.PackageType) string {
+
+	filename := util.FilenameFromPath(pkgName) + ".a"
+	return PkgBinDir(targetName, buildName, pkgName, pkgType) + "/" + filename
+}
+
 func AppElfPath(targetName string, buildName string, appName string) string {
 	return FileBinDir(targetName, buildName, appName) + "/" +
 		filepath.Base(appName) + ".elf"
@@ -124,7 +132,8 @@ func (b *Builder) PkgBinDir(bpkg *BuildPackage) string {
 
 // Generates the path+filename of the specified package's .a file.
 func (b *Builder) ArchivePath(bpkg *BuildPackage) string {
-	return b.PkgBinDir(bpkg) + "/" + filepath.Base(bpkg.Name()) + ".a"
+	return ArchivePath(b.targetPkg.Name(), b.buildName, bpkg.Name(),
+		bpkg.Type())
 }
 
 func (b *Builder) AppTentativeElfPath() string {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e7f31c7e/newt/vendor/mynewt.apache.org/newt/util/util.go
----------------------------------------------------------------------
diff --git a/newt/vendor/mynewt.apache.org/newt/util/util.go b/newt/vendor/mynewt.apache.org/newt/util/util.go
index 80d7507..d734174 100644
--- a/newt/vendor/mynewt.apache.org/newt/util/util.go
+++ b/newt/vendor/mynewt.apache.org/newt/util/util.go
@@ -579,6 +579,15 @@ func CIdentifier(s string) string {
 	return s
 }
 
+func FilenameFromPath(s string) string {
+	s = strings.Replace(s, "/", "_", -1)
+	s = strings.Replace(s, " ", "_", -1)
+	s = strings.Replace(s, "\t", "_", -1)
+	s = strings.Replace(s, "\n", "_", -1)
+
+	return s
+}
+
 func IntMax(a, b int) int {
 	if a > b {
 		return a

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/e7f31c7e/util/util.go
----------------------------------------------------------------------
diff --git a/util/util.go b/util/util.go
index 80d7507..d734174 100644
--- a/util/util.go
+++ b/util/util.go
@@ -579,6 +579,15 @@ func CIdentifier(s string) string {
 	return s
 }
 
+func FilenameFromPath(s string) string {
+	s = strings.Replace(s, "/", "_", -1)
+	s = strings.Replace(s, " ", "_", -1)
+	s = strings.Replace(s, "\t", "_", -1)
+	s = strings.Replace(s, "\n", "_", -1)
+
+	return s
+}
+
 func IntMax(a, b int) int {
 	if a > b {
 		return a


Mime
View raw message