Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Oct 27, 2024
1 parent 016a45f commit 700af0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
10 changes: 4 additions & 6 deletions src/php_minifier/Macro.hx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package php_minifier;

#if macro
import haxe.macro.Compiler;
import haxe.macro.Context;
import sys.io.File;
import sys.ssl.Socket;

/** Provides initialization macros. **/
abstract class Macro {

#if macro
/** Adds a shebang to the compiled file. **/
public static function shebang(executable: String) Context.onAfterGenerate(() -> {
final path = Compiler.getOutput();
public static function shebang(executable: String) haxe.macro.Context.onAfterGenerate(() -> {
final path = haxe.macro.Compiler.getOutput();
File.saveContent(path, '#!/usr/bin/env $executable\n${File.getContent(path)}');
});
#end

/** Enables or disables the verification of peer certificates during SSL handshake. **/
public static function verifySslCerts(value: Bool): Void
Socket.DEFAULT_VERIFY_CERT = value;
}
#end
12 changes: 3 additions & 9 deletions src/php_minifier/Platform.hx
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package php_minifier;

#if macro
import haxe.Json;
import haxe.macro.Context;
import sys.io.File;
#end

/** Information about the environment in which the current program is running. **/
abstract class Platform {

Expand All @@ -26,13 +20,13 @@ abstract class Platform {

/** Gets the name of the Haxe compilation target. **/
macro static function getHaxeTarget()
return macro $v{Context.definedValue("target.name")};
return macro $v{haxe.macro.Context.definedValue("target.name")};

/** Gets the version number of the Haxe compiler. **/
macro static function getHaxeVersion()
return macro $v{Context.definedValue("haxe")};
return macro $v{haxe.macro.Context.definedValue("haxe")};

/** Gets the package version of this program. **/
macro static function getPackageVersion()
return macro $v{Json.parse(File.getContent("haxelib.json")).version};
return macro $v{haxe.Json.parse(sys.io.File.getContent("haxelib.json")).version};
}

0 comments on commit 700af0f

Please sign in to comment.