summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-06-12 00:38:40 +0800
committerruki <[email protected]>2019-06-11 21:52:04 +0800
commit52f3bbe24e365b28f4bcd1e277d178a2561a1e8b (patch)
tree75dbf9dd3ab1636175f9ea0ad230ea9e64b96638
parente4043f6851c5de222c27830f42c1134d7397e1cb (diff)
generate template gitignore
-rw-r--r--xmake/core/project/template.lua5
-rw-r--r--xmake/scripts/gitignore6
-rw-r--r--xmake/templates/c++/console/project/.gitignore8
-rw-r--r--xmake/templates/c++/console_qt/project/.gitignore8
-rw-r--r--xmake/templates/c++/console_tbox/project/.gitignore8
-rw-r--r--xmake/templates/c++/shared_library/project/.gitignore8
-rw-r--r--xmake/templates/c++/shared_library_qt/project/.gitignore8
-rw-r--r--xmake/templates/c++/shared_library_tbox/project/.gitignore8
-rw-r--r--xmake/templates/c++/static_library/project/.gitignore8
-rw-r--r--xmake/templates/c++/static_library_qt/project/.gitignore8
-rw-r--r--xmake/templates/c++/static_library_tbox/project/.gitignore8
-rw-r--r--xmake/templates/c/console/project/.gitignore8
-rw-r--r--xmake/templates/c/console_tbox/.gitignore8
-rw-r--r--xmake/templates/c/shared_library/project/.gitignore8
-rw-r--r--xmake/templates/c/shared_library_tbox/project/.gitignore8
-rw-r--r--xmake/templates/c/static_library/project/.gitignore8
-rw-r--r--xmake/templates/c/static_library_tbox/project/.gitignore8
-rw-r--r--xmake/templates/cuda/console/project/.gitignore8
-rw-r--r--xmake/templates/cuda/shared_library/project/.gitignore2
-rw-r--r--xmake/templates/cuda/static_library/project/.gitignore2
-rw-r--r--xmake/templates/dlang/console/project/.gitignore8
-rw-r--r--xmake/templates/dlang/shared_library/project/.gitignore8
-rw-r--r--xmake/templates/dlang/static_library/project/.gitignore8
-rw-r--r--xmake/templates/go/console/project/.gitignore8
-rw-r--r--xmake/templates/go/static_library/project/.gitignore8
-rw-r--r--xmake/templates/objc++/console/project/.gitignore8
-rw-r--r--xmake/templates/objc/console/project/.gitignore8
-rw-r--r--xmake/templates/rust/console/project/.gitignore8
-rw-r--r--xmake/templates/rust/static_library/project/.gitignore8
-rw-r--r--xmake/templates/swift/console/project/.gitignore8
30 files changed, 7 insertions, 216 deletions
diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua
index 8f6e959f1..27dc34e42 100644
--- a/xmake/core/project/template.lua
+++ b/xmake/core/project/template.lua
@@ -280,7 +280,7 @@ function template.create(language, templateid, targetname)
-- append FAQ to xmake.lua
local projectfile = path.join(projectdir, "xmake.lua")
if os.isfile(projectfile) then
- local file = io.open("xmake.lua", "a+")
+ local file = io.open(projectfile, "a+")
if file then
file:print("")
file:print(template.faq())
@@ -288,6 +288,9 @@ function template.create(language, templateid, targetname)
end
end
+ -- generate .gitignore
+ os.cp(path.join(os.programdir(), "scripts", "gitignore"), path.join(projectdir, ".gitignore"))
+
-- ok
return true
end
diff --git a/xmake/scripts/gitignore b/xmake/scripts/gitignore
index b849bb8f7..152105761 100644
--- a/xmake/scripts/gitignore
+++ b/xmake/scripts/gitignore
@@ -1,8 +1,8 @@
-# xmake temp files
+# Xmake cache
.xmake/
-# build result files
build/
-.DS_Store/
+# MacOS Cache
+.DS_Store
diff --git a/xmake/templates/c++/console/project/.gitignore b/xmake/templates/c++/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/console_qt/project/.gitignore b/xmake/templates/c++/console_qt/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/console_qt/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/console_tbox/project/.gitignore b/xmake/templates/c++/console_tbox/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/console_tbox/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/shared_library/project/.gitignore b/xmake/templates/c++/shared_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/shared_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/shared_library_qt/project/.gitignore b/xmake/templates/c++/shared_library_qt/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/shared_library_qt/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/shared_library_tbox/project/.gitignore b/xmake/templates/c++/shared_library_tbox/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/shared_library_tbox/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/static_library/project/.gitignore b/xmake/templates/c++/static_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/static_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/static_library_qt/project/.gitignore b/xmake/templates/c++/static_library_qt/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/static_library_qt/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c++/static_library_tbox/project/.gitignore b/xmake/templates/c++/static_library_tbox/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c++/static_library_tbox/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/console/project/.gitignore b/xmake/templates/c/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/console_tbox/.gitignore b/xmake/templates/c/console_tbox/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/console_tbox/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/shared_library/project/.gitignore b/xmake/templates/c/shared_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/shared_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/shared_library_tbox/project/.gitignore b/xmake/templates/c/shared_library_tbox/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/shared_library_tbox/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/static_library/project/.gitignore b/xmake/templates/c/static_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/static_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/c/static_library_tbox/project/.gitignore b/xmake/templates/c/static_library_tbox/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/c/static_library_tbox/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/cuda/console/project/.gitignore b/xmake/templates/cuda/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/cuda/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/cuda/shared_library/project/.gitignore b/xmake/templates/cuda/shared_library/project/.gitignore
deleted file mode 100644
index 173fb6eaf..000000000
--- a/xmake/templates/cuda/shared_library/project/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.xmake
-build
diff --git a/xmake/templates/cuda/static_library/project/.gitignore b/xmake/templates/cuda/static_library/project/.gitignore
deleted file mode 100644
index 173fb6eaf..000000000
--- a/xmake/templates/cuda/static_library/project/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.xmake
-build
diff --git a/xmake/templates/dlang/console/project/.gitignore b/xmake/templates/dlang/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/dlang/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/dlang/shared_library/project/.gitignore b/xmake/templates/dlang/shared_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/dlang/shared_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/dlang/static_library/project/.gitignore b/xmake/templates/dlang/static_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/dlang/static_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/go/console/project/.gitignore b/xmake/templates/go/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/go/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/go/static_library/project/.gitignore b/xmake/templates/go/static_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/go/static_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/objc++/console/project/.gitignore b/xmake/templates/objc++/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/objc++/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/objc/console/project/.gitignore b/xmake/templates/objc/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/objc/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/rust/console/project/.gitignore b/xmake/templates/rust/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/rust/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/rust/static_library/project/.gitignore b/xmake/templates/rust/static_library/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/rust/static_library/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-
diff --git a/xmake/templates/swift/console/project/.gitignore b/xmake/templates/swift/console/project/.gitignore
deleted file mode 100644
index b849bb8f7..000000000
--- a/xmake/templates/swift/console/project/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# xmake temp files
-.xmake/
-# build result files
-build/
-
-.DS_Store/
-
-