Commits

Jason Perkins committed 69afa0e

Display deprecation warning for "ng" actions; properly reset state between unit tests

Comments (0)

Files changed (3)

src/_premake_main.lua

 		_PREMAKE_COMMAND = path.getabsolute(_PREMAKE_COMMAND)
 
 
+		-- The "next-gen" actions have now replaced their deprecated counterparts. 
+		-- Provide a warning for a little while before I remove them entirely.
+		if _ACTION:endswith("ng") then
+			_ACTION = _ACTION:sub(1, -3)
+			print(string.format("** Warning: '%sng' has been deprecated; use '%s' instead", _ACTION, _ACTION))
+		end
+
 		-- Set up the environment for the chosen action early, so side-effects
 		-- can be picked up by the scripts.
 
 
 
 --
+-- Clears all active API objects; resets to root configuration block.
+--
+
+	function api.reset()
+		api.scope = {
+			root = { 
+				configset = configset.root,
+				blocks = {}  -- TODO: remove this when switch-over to new APIs is done
+			}
+		}
+	end
+
+
+--
 -- Set a new array value. Arrays are lists of values stored by "value",
 -- in that new values overwrite old ones, rather than merging like lists.
 --
 -- Everything below this point is a candidate for deprecation
 -----------------------------------------------------------------------------
 
-
---
--- Set up a dummy "root" container to hold global configuration data. This
--- can go away with the rest of this deprecated code when the new config
--- system is finished.
---
-
-	api.scope.root = {
-		configset = configset.root,
-		blocks = {}
-	}
+	api.reset()
 
 	premake.CurrentContainer = api.scope.root
 
 		_OS = _OS_host
 
 		premake.solution.list = { }
-		premake.api.scope = { }
+		premake.api.reset()
 
 		io.indent = nil
 		io.eol = "\n"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.