cmd/gomobile: skip the hidden asset files
gomobile builds apps with hidden files from the assets directory.
The final applications should skip files like .DS_Store, .gitignore,
etc. Therefore, walker needs to skip the hidden files.
Change-Id: Ibbf7010d525cc831a009f3680f84063f40ac570f
Reviewed-on: https://go-review.googlesource.com/14825
Reviewed-by: David Crawshaw <crawshaw@golang.org>
diff --git a/cmd/gomobile/build_androidapp.go b/cmd/gomobile/build_androidapp.go
index 1f6a230..797040d 100644
--- a/cmd/gomobile/build_androidapp.go
+++ b/cmd/gomobile/build_androidapp.go
@@ -188,6 +188,10 @@
if err != nil {
return err
}
+ if name := filepath.Base(path); strings.HasPrefix(name, ".") {
+ // Do not include the hidden files.
+ return nil
+ }
if info.IsDir() {
return nil
}
diff --git a/cmd/gomobile/build_iosapp.go b/cmd/gomobile/build_iosapp.go
index 9c78a02..11b6ed6 100644
--- a/cmd/gomobile/build_iosapp.go
+++ b/cmd/gomobile/build_iosapp.go
@@ -149,6 +149,10 @@
if err != nil {
return err
}
+ if name := filepath.Base(path); strings.HasPrefix(name, ".") {
+ // Do not include the hidden files.
+ return nil
+ }
if info.IsDir() {
return nil
}