Skip to content

Commit

Permalink
Rename the root package to "hashlink"
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Oct 25, 2024
1 parent f8f797b commit 9bc1112
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 67 deletions.
75 changes: 38 additions & 37 deletions bin/setup_hashlink.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--js bin/setup_hashlink.js
--macro setup_hashlink.Macro.shebang("node")
--main setup_hashlink.Program
--macro hashlink.Macro.shebang("node")
--main hashlink.Program
share/build.hxml
2 changes: 1 addition & 1 deletion etc/checkstyle.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"defaultSeverity": "ERROR",
"exclude": {
"path": "RELATIVE_TO_PROJECT",
"HiddenField": ["src/setup_hashlink/Release"]
"HiddenField": ["src/hashlink/Release"]
},
"checks": [
{"type": "ArrayAccess"},
Expand Down
2 changes: 1 addition & 1 deletion scripts/Publish.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! --class-path src --library tink_core
import setup_hashlink.Platform;
import hashlink.Platform;

/** Publishes the package. **/
function main() {
Expand Down
2 changes: 1 addition & 1 deletion scripts/Version.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! --class-path src --library tink_core
import setup_hashlink.Platform;
import hashlink.Platform;
import sys.io.File;

/** Updates the version number in the sources. **/
Expand Down
2 changes: 1 addition & 1 deletion src/setup_hashlink/Macro.hx → src/hashlink/Macro.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

#if macro
import haxe.macro.Compiler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

/** Defines the operating system or platform of the HashLink VM. **/
enum abstract OperatingSystem(String) from String to String {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

#if macro
import haxe.Json;
Expand Down
2 changes: 1 addition & 1 deletion src/setup_hashlink/Program.hx → src/hashlink/Program.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

import js.actions.Core;
import js.Node;
Expand Down
6 changes: 3 additions & 3 deletions src/setup_hashlink/Release.hx → src/hashlink/Release.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

import coconut.data.List;
import coconut.data.Model;
Expand All @@ -9,7 +9,7 @@ import tink.semver.Constraint;
import tink.semver.Version;

/** Represents a GitHub release. **/
@:jsonParse(json -> new setup_hashlink.Release(json))
@:jsonParse(json -> new hashlink.Release(json))
class Release implements Model {

/** The latest release. **/
Expand Down Expand Up @@ -61,7 +61,7 @@ class Release implements Model {
}

/** Represents an asset of a GitHub release. **/
@:jsonParse(json -> new setup_hashlink.Release.ReleaseAsset(json))
@:jsonParse(json -> new hashlink.Release.ReleaseAsset(json))
class ReleaseAsset implements Model {

/** The target file. **/
Expand Down
2 changes: 1 addition & 1 deletion src/setup_hashlink/Setup.hx → src/hashlink/Setup.hx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

import js.actions.Core;
import js.actions.ToolCache;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions test/RunTests.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import tink.unit.TestBatch;
/** Runs the test suite. **/
function main() {
final tests = TestBatch.make([
new setup_hashlink.ReleaseTest(),
new setup_hashlink.SetupTest()
new hashlink.ReleaseTest(),
new hashlink.SetupTest()
]);

ANSI.stripIfUnavailable = false;
Expand Down
28 changes: 14 additions & 14 deletions test/setup_hashlink/ReleaseTest.hx → test/hashlink/ReleaseTest.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package setup_hashlink;
package hashlink;

import setup_hashlink.Release.ReleaseAsset;
import hashlink.Release.ReleaseAsset;

/** Tests the features of the `Release` class. **/
@:asserts final class ReleaseTest {
Expand All @@ -19,14 +19,14 @@ import setup_hashlink.Release.ReleaseAsset;
public function new() {}

/** Tests the `exists` property. **/
@:variant(setup_hashlink.ReleaseTest.existingRelease, true)
@:variant(setup_hashlink.ReleaseTest.nonExistentRelease, false)
@:variant(hashlink.ReleaseTest.existingRelease, true)
@:variant(hashlink.ReleaseTest.nonExistentRelease, false)
public function exists(input: Release, output: Bool)
return assert(input.exists == output);

/** Tests the `isSource` property. **/
@:variant(setup_hashlink.ReleaseTest.existingRelease, false)
@:variant(setup_hashlink.ReleaseTest.nonExistentRelease, true)
@:variant(hashlink.ReleaseTest.existingRelease, false)
@:variant(hashlink.ReleaseTest.nonExistentRelease, true)
public function isSource(input: Release, output: Bool)
return assert(input.isSource == output);

Expand All @@ -37,20 +37,20 @@ import setup_hashlink.Release.ReleaseAsset;
}

/** Tests the `tag` property. **/
@:variant(setup_hashlink.ReleaseTest.existingRelease, "1.14")
@:variant(setup_hashlink.ReleaseTest.nonExistentRelease, "666.6.6")
@:variant(hashlink.ReleaseTest.existingRelease, "1.14")
@:variant(hashlink.ReleaseTest.nonExistentRelease, "666.6.6")
public function tag(input: Release, output: String)
return assert(input.tag == output);

/** Tests the `url` property. **/
@:variant(setup_hashlink.ReleaseTest.existingRelease, "releases/download/1.14/hashlink-1.14.0.zip")
@:variant(setup_hashlink.ReleaseTest.nonExistentRelease, "archive/refs/tags/666.6.6.zip")
@:variant(hashlink.ReleaseTest.existingRelease, "releases/download/1.14/hashlink-1.14.0.zip")
@:variant(hashlink.ReleaseTest.nonExistentRelease, "archive/refs/tags/666.6.6.zip")
public function url(input: Release, output: String)
return assert(input.url == 'https://github.com/HaxeFoundation/hashlink/$output');

/** Tests the `find()` method. **/
@:variant("*", Some(setup_hashlink.Release.latest.version))
@:variant("1.x", Some(setup_hashlink.Release.latest.version))
@:variant("*", Some(hashlink.Release.latest.version))
@:variant("1.x", Some(hashlink.Release.latest.version))
@:variant("=1.0.0", Some("1.0.0"))
@:variant(">=1.0.0 <1.11.0", Some("1.10.0"))
@:variant("666.6.6", None)
Expand All @@ -68,8 +68,8 @@ import setup_hashlink.Release.ReleaseAsset;
}

/** Tests the `getAsset()` method. **/
@:variant(setup_hashlink.ReleaseTest.existingRelease, Some("hashlink-1.14.0.zip"))
@:variant(setup_hashlink.ReleaseTest.nonExistentRelease, None)
@:variant(hashlink.ReleaseTest.existingRelease, Some("hashlink-1.14.0.zip"))
@:variant(hashlink.ReleaseTest.nonExistentRelease, None)
public function getAsset(input: Release, output: Option<String>) return switch input.getAsset(Windows) {
case None: assert(output == None);
case Some(asset): assert(output.equals(asset.file));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package setup_hashlink;
package hashlink;

import sys.FileSystem;
using Lambda;
Expand Down
File renamed without changes.

0 comments on commit 9bc1112

Please sign in to comment.