summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-20 14:26:08 +0800
committerruki <[email protected]>2017-07-20 14:26:08 +0800
commitb0eeeda1f43bf10f52069d2ab8fd651b164b70ea (patch)
tree1fa10bc1c7cdd3ba35fc2f213f75b77ae0faf64e
parenta9a33cca711e2bc6d88594e2ab6b99921d5992f2 (diff)
rename core.project.task to core.base.task
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/actions/build/main.lua2
-rw-r--r--xmake/actions/clean/main.lua2
-rw-r--r--xmake/actions/install/install.lua2
-rw-r--r--xmake/actions/install/main.lua2
-rw-r--r--xmake/actions/package/main.lua2
-rw-r--r--xmake/actions/run/main.lua2
-rw-r--r--xmake/actions/uninstall/main.lua2
-rw-r--r--xmake/actions/uninstall/uninstall.lua2
-rw-r--r--xmake/core/base/task.lua (renamed from xmake/core/project/task.lua)0
-rw-r--r--xmake/core/main.lua2
-rw-r--r--xmake/core/sandbox/modules/import/core/base/task.lua69
-rw-r--r--xmake/core/sandbox/modules/import/core/project/task.lua47
-rw-r--r--xmake/plugins/project/main.lua2
14 files changed, 83 insertions, 55 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 28555f510..3e96d687b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,7 @@
* Support `*.asm` source files for vs201x project plugin
* Mark `add_bindings` and `add_rbindings` as deprecated
* Optimize `xmake rebuild` speed on windows
+* Move `core.project.task` to `core.base.task`
### Bugs fixed
@@ -350,6 +351,7 @@
* 在vs201x工程插件中增加对`*.asm`文件的支持
* 标记`add_bindings`和`add_rbindings`为废弃接口
* 优化`xmake rebuild`在windows上的构建速度
+* 将`core.project.task`模块迁移至`core.base.task`
### Bugs修复
diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua
index e29645d14..22d8bc4dd 100644
--- a/xmake/actions/build/main.lua
+++ b/xmake/actions/build/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.project.config")
import("core.project.project")
import("core.project.cache", {nocache = true})
diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua
index f35c0e224..eef366444 100644
--- a/xmake/actions/clean/main.lua
+++ b/xmake/actions/clean/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.project.config")
import("core.base.global")
import("core.project.project")
diff --git a/xmake/actions/install/install.lua b/xmake/actions/install/install.lua
index c3c36e61c..b96ab5943 100644
--- a/xmake/actions/install/install.lua
+++ b/xmake/actions/install/install.lua
@@ -23,7 +23,7 @@
--
-- imports
-import("core.project.task")
+import("core.base.task")
import("core.project.project")
import("core.platform.platform")
diff --git a/xmake/actions/install/main.lua b/xmake/actions/install/main.lua
index 976478a76..efee4e2ba 100644
--- a/xmake/actions/install/main.lua
+++ b/xmake/actions/install/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.platform.platform")
import("core.base.privilege")
import("privilege.sudo")
diff --git a/xmake/actions/package/main.lua b/xmake/actions/package/main.lua
index ae88d661c..0823d6924 100644
--- a/xmake/actions/package/main.lua
+++ b/xmake/actions/package/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.project.config")
import("core.base.global")
import("core.project.project")
diff --git a/xmake/actions/run/main.lua b/xmake/actions/run/main.lua
index ee30b6c7c..a9e8d0d7e 100644
--- a/xmake/actions/run/main.lua
+++ b/xmake/actions/run/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.project.config")
import("core.base.global")
import("core.project.project")
diff --git a/xmake/actions/uninstall/main.lua b/xmake/actions/uninstall/main.lua
index 36b113181..cc9e09d10 100644
--- a/xmake/actions/uninstall/main.lua
+++ b/xmake/actions/uninstall/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.platform.platform")
import("core.base.privilege")
import("privilege.sudo")
diff --git a/xmake/actions/uninstall/uninstall.lua b/xmake/actions/uninstall/uninstall.lua
index 8f468c29c..ae6ca9706 100644
--- a/xmake/actions/uninstall/uninstall.lua
+++ b/xmake/actions/uninstall/uninstall.lua
@@ -23,7 +23,7 @@
--
-- imports
-import("core.project.task")
+import("core.base.task")
import("core.project.project")
import("core.platform.platform")
diff --git a/xmake/core/project/task.lua b/xmake/core/base/task.lua
index 6da3c26ee..6da3c26ee 100644
--- a/xmake/core/project/task.lua
+++ b/xmake/core/base/task.lua
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index 2e860269a..fdfe3db5f 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -33,7 +33,7 @@ local option = require("base/option")
local profiler = require("base/profiler")
local deprecated = require("base/deprecated")
local privilege = require("base/privilege")
-local task = require("project/task")
+local task = require("base/task")
local project = require("project/project")
local history = require("project/history")
diff --git a/xmake/core/sandbox/modules/import/core/base/task.lua b/xmake/core/sandbox/modules/import/core/base/task.lua
new file mode 100644
index 000000000..f8008b3a4
--- /dev/null
+++ b/xmake/core/sandbox/modules/import/core/base/task.lua
@@ -0,0 +1,69 @@
+--!The Make-like Build Utility based on Lua
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015 - 2017, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file task.lua
+--
+
+-- define module
+local sandbox_core_project_task = sandbox_core_project_task or {}
+
+-- load modules
+local os = require("base/os")
+local io = require("base/io")
+local table = require("base/table")
+local option = require("base/option")
+local string = require("base/string")
+local task = require("base/task")
+local raise = require("sandbox/modules/raise")
+
+-- run the given task
+function sandbox_core_project_task.run(taskname, options, ...)
+
+ -- init options
+ options = table.wrap(options)
+
+ -- inherit some parent options
+ for _, name in ipairs({"file", "project", "backtrace", "verbose", "quiet", "root", "profile"}) do
+ if not options[name] and option.get(name) then
+ options[name] = option.get(name)
+ end
+ end
+
+ -- save the current option and push a new option context
+ option.save(taskname)
+
+ -- init the new options
+ for name, value in pairs(options) do
+ option.set(name, value)
+ end
+
+ -- run the task
+ local ok, errors = task.run(taskname, ...)
+ if not ok then
+ raise(errors)
+ end
+
+ -- restore the previous option context
+ option.restore()
+end
+
+-- return module
+return sandbox_core_project_task
diff --git a/xmake/core/sandbox/modules/import/core/project/task.lua b/xmake/core/sandbox/modules/import/core/project/task.lua
index 7098df4d3..9652d0beb 100644
--- a/xmake/core/sandbox/modules/import/core/project/task.lua
+++ b/xmake/core/sandbox/modules/import/core/project/task.lua
@@ -22,48 +22,5 @@
-- @file task.lua
--
--- define module
-local sandbox_core_project_task = sandbox_core_project_task or {}
-
--- load modules
-local os = require("base/os")
-local io = require("base/io")
-local table = require("base/table")
-local option = require("base/option")
-local string = require("base/string")
-local task = require("project/task")
-local raise = require("sandbox/modules/raise")
-
--- run the given task
-function sandbox_core_project_task.run(taskname, options, ...)
-
- -- init options
- options = table.wrap(options)
-
- -- inherit some parent options
- for _, name in ipairs({"file", "project", "backtrace", "verbose", "quiet", "root", "profile"}) do
- if not options[name] and option.get(name) then
- options[name] = option.get(name)
- end
- end
-
- -- save the current option and push a new option context
- option.save(taskname)
-
- -- init the new options
- for name, value in pairs(options) do
- option.set(name, value)
- end
-
- -- run the task
- local ok, errors = task.run(taskname, ...)
- if not ok then
- raise(errors)
- end
-
- -- restore the previous option context
- option.restore()
-end
-
--- return module
-return sandbox_core_project_task
+-- deprecatd: return module
+return require("sandbox/modules/import/core/base/task")
diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua
index c949fa70f..a12261ab8 100644
--- a/xmake/plugins/project/main.lua
+++ b/xmake/plugins/project/main.lua
@@ -24,7 +24,7 @@
-- imports
import("core.base.option")
-import("core.project.task")
+import("core.base.task")
import("core.platform.environment")
import("makefile.makefile")
import("vstudio.vs2002")