Bladeren bron

Move record macros to a separate project

See https://github.com/HaxeFoundation/record-macros
Closes #3676
Cauê Waneck 8 jaren geleden
bovenliggende
commit
da5d12cf84

+ 1 - 0
std/sys/db/Manager.hx

@@ -29,6 +29,7 @@ import sys.db.RecordInfos;
 	Haxe website to learn how to use Record.
 **/
 #if !macro @:build(sys.db.RecordMacros.addRtti()) #end
+@:deprecated("This class will be removed soon, please install the record-macros library")
 class Manager<T : Object> {
 
 	/* ----------------------------- STATICS ------------------------------ */

+ 1 - 0
std/sys/db/Object.hx

@@ -27,6 +27,7 @@ package sys.db;
 **/
 @:keepSub
 @:autoBuild(sys.db.RecordMacros.macroBuild()) @:skipFields
+@:deprecated("This class will be removed soon, please install the record-macros library")
 class Object {
 
 	var _lock(default,never) : Bool;

+ 4 - 0
std/sys/db/RecordInfos.hx

@@ -21,6 +21,7 @@
  */
 package sys.db;
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 enum RecordType {
 	DId;
 	DInt;
@@ -59,12 +60,14 @@ enum RecordType {
 	DNull;
 }
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef RecordField = {
 	var name : String;
 	var t : RecordType;
 	var isNull : Bool;
 }
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef RecordRelation = {
 	var prop : String;
 	var key : String;
@@ -75,6 +78,7 @@ typedef RecordRelation = {
 	var isNull : Bool;
 }
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef RecordInfos = {
 	var name : String;
 	var key : Array<String>;

+ 1 - 0
std/sys/db/RecordMacros.hx

@@ -36,6 +36,7 @@ private typedef SqlFunction = {
 	var sql : String;
 }
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 class RecordMacros {
 
 	static var GLOBAL = null;

+ 1 - 0
std/sys/db/TableCreate.hx

@@ -22,6 +22,7 @@
 package sys.db;
 import sys.db.RecordInfos;
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 class TableCreate {
 
 	static function autoInc( dbName ) {

+ 34 - 0
std/sys/db/Types.hx

@@ -25,103 +25,137 @@ package sys.db;
 
 /** int with auto increment **/
 @:noPackageRestrict
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SId = Null<Int>
 
 /** int unsigned with auto increment **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SUId = Null<Int>
 
 /** big int with auto increment **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SBigId = Null<Float>
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SInt = Null<Int>
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SUInt = Null<Int>
 
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SBigInt = Null<Float>
 
 /** single precision float **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSingle = Null<Float>
 
 /** double precision float **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SFloat = Null<Float>
 
 /** use `tinyint(1)` to distinguish with int **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SBool = Null<Bool>
 
 /** same as `varchar(n)` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SString<Const> = String
 
 /** date only, use `SDateTime` for date+time **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SDate = Date
 
 /** mysql DateTime **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SDateTime = Date
 
 /** mysql Timestamp **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef STimeStamp = Date
 
 /** TinyText (up to 255 bytes) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef STinyText = String
 
 /** Text (up to 64KB) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSmallText = String
 
 /** MediumText (up to 24MB) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SText = String
 
 /** Blob type (up to 64KB) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSmallBinary = haxe.io.Bytes
 
 /** LongBlob type (up to 4GB) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SLongBinary = haxe.io.Bytes
 
 /** MediumBlob type (up to 24MB) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SBinary = haxe.io.Bytes
 
 /** same as binary(n) **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SBytes<Const> = haxe.io.Bytes
 
 /** one byte signed `-128...127` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef STinyInt = Null<Int>
 
 /** two bytes signed `-32768...32767` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSmallInt = Null<Int>
 
 /** three bytes signed `-8388608...8388607` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SMediumInt = Null<Int>
 
 /** one byte `0...255` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef STinyUInt = Null<Int>
 
 /** two bytes `0...65535` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSmallUInt = Null<Int>
 
 /** three bytes `0...16777215` **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SMediumUInt = Null<Int>
 
 // extra
 
 /** specify that this field is nullable **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SNull<T> = Null<T>
 
 /** specify that the integer use custom encoding **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SEncoded = Null<Int>
 
 /** Haxe Serialized string **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSerialized = String
 
 /** native neko serialized bytes **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SNekoSerialized = haxe.io.Bytes
 
 /** a set of bitflags of different enum values **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SFlags<T:EnumValue> = Null<haxe.EnumFlags<T>>
 
 /** same as `SFlags` but will adapt the storage size to the number of flags **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SSmallFlags<T:EnumValue> = SFlags<T>;
 
 /** allow to store any value in serialized form **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SData<T> = Null<T>
 
 /** allow to store an enum value that does not have parameters as a simple int **/
+@:deprecated("This class will be removed soon, please install the record-macros library")
 typedef SEnum<E:EnumValue> = Null<E>
 

+ 20 - 0
tests/RunCi.hx

@@ -421,6 +421,21 @@ class RunCi {
 		gotCppDependencies = true;
 	}
 
+	static var gotSpodDependencies = false;
+  static function getSpodDependencies() {
+		if (gotSpodDependencies ) return;
+
+		//install and build hxcpp
+		try {
+			getHaxelibPath("record-macros");
+			infoMsg('record-macros has already been installed.');
+		} catch(e:Dynamic) {
+			haxelibInstallGit("HaxeFoundation", "record-macros", true);
+		}
+
+		gotSpodDependencies = true;
+  }
+
 	static function getJavaDependencies() {
 		haxelibInstallGit("HaxeFoundation", "hxjava", true);
 
@@ -821,6 +836,7 @@ class RunCi {
 						runCommand("haxe", ["compile-macro.hxml"]);
 						runCommand("haxe", ["compile-each.hxml", "--run", "Main"]);
 					case Neko:
+						getSpodDependencies();
 						runCommand("haxe", ["compile-neko.hxml", "-D", "dump", "-D", "dump_ignore_var_ids"].concat(args));
 						runCommand("neko", ["bin/unit.n"]);
 
@@ -828,6 +844,7 @@ class RunCi {
 						runCommand("haxe", ["compile-neko.hxml"]);
 						runCommand("neko", ["bin/neko/sys.n"]);
 					case Php:
+						getSpodDependencies();
 						getPhpDependencies();
 						runCommand("haxe", ["compile-php.hxml"].concat(args));
 						runCommand("php", ["bin/php/index.php"]);
@@ -860,6 +877,7 @@ class RunCi {
 						runCommand("lua", ["bin/unit.lua"]);
 					case Cpp:
 						getCppDependencies();
+						getSpodDependencies();
 						runCommand("haxe", ["compile-cpp.hxml", "-D", "HXCPP_M32"].concat(args));
 						runCpp("bin/cpp/TestMain-debug", []);
 
@@ -950,6 +968,7 @@ class RunCi {
 						changeDirectory(optDir);
 						runCommand("haxe", ["run.hxml"]);
 					case Java:
+						getSpodDependencies();
 						getJavaDependencies();
 						runCommand("haxe", ["compile-java.hxml"].concat(args));
 						runCommand("java", ["-jar", "bin/java/TestMain-Debug.jar"]);
@@ -977,6 +996,7 @@ class RunCi {
 						}
 
 					case Cs:
+						getSpodDependencies();
 						getCsDependencies();
 
 						var compl = switch [ci, systemName] {

+ 1 - 0
tests/unit/compile-cpp.hxml

@@ -2,3 +2,4 @@ compile-each.hxml
 -main unit.TestMain
 -cpp bin/cpp
 -D HXCPP_NO_DEBUG_LINK
+-lib record-macros

+ 1 - 0
tests/unit/compile-cs-travis.hxml

@@ -5,3 +5,4 @@ compile-cs.hxml
 -net-lib cs_drivers/Mono.Data.Sqlite.dll
 
 -D travis
+-lib record-macros

+ 1 - 1
tests/unit/compile-java.hxml

@@ -9,4 +9,4 @@ compile-each.hxml
 -java-lib native_java/native.jar
 -java-lib java_drivers/mysql-connector-java-5.1.32-bin.jar
 -java-lib java_drivers/sqlite-jdbc-3.7.2.jar
--D dump
+-lib record-macros

+ 2 - 1
tests/unit/compile-neko.hxml

@@ -1,4 +1,5 @@
 compile-each.hxml
 -D neko_v2
 -main unit.TestMain
--neko bin/unit.n
+-neko bin/unit.n
+-lib record-macros

+ 2 - 1
tests/unit/compile-php.hxml

@@ -1,3 +1,4 @@
 compile-each.hxml
 -main unit.TestMain
--php bin/php
+-php bin/php
+-lib record-macros