mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-05-28 17:06:34 +03:00
Fixed tests
This commit is contained in:
@@ -396,6 +396,7 @@ project(":tests"){
|
||||
testImplementation arcModule("backends:backend-headless")
|
||||
testImplementation "org.json:json:20230618"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
|
||||
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile){
|
||||
|
||||
@@ -102,7 +102,7 @@ static void antialias(File file){
|
||||
new Fi(file).writePng(out)
|
||||
}
|
||||
|
||||
task antialiasImages(){
|
||||
tasks.register('antialiasImages'){
|
||||
doLast{
|
||||
for(def img : project.getProperty("images").split(",")){
|
||||
println(project.getProperty("startdir") + "/" + img)
|
||||
@@ -111,7 +111,7 @@ task antialiasImages(){
|
||||
}
|
||||
}
|
||||
|
||||
task tileImages(){
|
||||
tasks.register('tileImages'){
|
||||
doLast{
|
||||
for(def img : project.getProperty("images").split(",")){
|
||||
println(project.getProperty("startdir") + "/" + img)
|
||||
@@ -120,7 +120,8 @@ task tileImages(){
|
||||
}
|
||||
}
|
||||
|
||||
task pack(dependsOn: [classes, configurations.runtimeClasspath]){
|
||||
tasks.register('pack'){
|
||||
dependsOn = [classes, configurations.runtimeClasspath]
|
||||
|
||||
doLast{
|
||||
//cleanup old sprites
|
||||
@@ -189,7 +190,8 @@ task pack(dependsOn: [classes, configurations.runtimeClasspath]){
|
||||
}
|
||||
}
|
||||
|
||||
task genSprites(dependsOn: classes, type: JavaExec){
|
||||
tasks.register('genSprites', JavaExec){
|
||||
dependsOn classes
|
||||
finalizedBy 'antialiasGen'
|
||||
|
||||
mainClass = "mindustry.tools.ImagePacker"
|
||||
@@ -198,7 +200,8 @@ task genSprites(dependsOn: classes, type: JavaExec){
|
||||
workingDir = genFolder
|
||||
}
|
||||
|
||||
task fontgen(dependsOn: classes, type: JavaExec){
|
||||
tasks.register('fontgen', JavaExec){
|
||||
dependsOn classes
|
||||
/* icon font pipeline:
|
||||
1. take set of pre-defined icons and SVGs
|
||||
2. use Fontello API to get a font with these
|
||||
@@ -233,30 +236,32 @@ task fontgen(dependsOn: classes, type: JavaExec){
|
||||
//TODO this is broken
|
||||
|
||||
Log.info(OS.exec("fontforge", "-script",
|
||||
Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(),
|
||||
Fi.get("core/assets/fonts/font.woff").absolutePath(),
|
||||
Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath())
|
||||
Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(),
|
||||
Fi.get("core/assets/fonts/font.woff").absolutePath(),
|
||||
Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath())
|
||||
)
|
||||
|
||||
Log.info("Done.")
|
||||
}
|
||||
}
|
||||
|
||||
task icongen(dependsOn: classes, type: JavaExec){
|
||||
tasks.register('icongen', JavaExec){
|
||||
dependsOn classes
|
||||
mainClass = "mindustry.tools.IconConverter"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
standardInput = System.in
|
||||
workingDir = "../core/assets-raw"
|
||||
}
|
||||
|
||||
task updateScripts(dependsOn: classes, type: JavaExec){
|
||||
tasks.register('updateScripts', JavaExec){
|
||||
dependsOn classes
|
||||
mainClass = "mindustry.tools.ScriptMainGenerator"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
standardInput = System.in
|
||||
workingDir = "../"
|
||||
}
|
||||
|
||||
task updateBundles{
|
||||
tasks.register('updateBundles'){
|
||||
doLast{
|
||||
def uniEscape = { String string ->
|
||||
StringBuilder outBuffer = new StringBuilder()
|
||||
@@ -264,12 +269,12 @@ task updateBundles{
|
||||
for(int i = 0; i < len; i++){
|
||||
char ch = string.charAt(i)
|
||||
if((ch > 61) && (ch < 127)){
|
||||
outBuffer.append(ch == (char)'\\' ? "\\\\" : ch)
|
||||
outBuffer.append(ch == (char) '\\' ? "\\\\" : ch)
|
||||
continue
|
||||
}
|
||||
|
||||
if(ch >= 0xE000 && ch <= 0xF8FF){
|
||||
String hex = Integer.toHexString((int)ch)
|
||||
String hex = Integer.toHexString((int) ch)
|
||||
outBuffer.append("\\u")
|
||||
for(int j = 0; j < 4 - hex.length(); j++){
|
||||
outBuffer.append('0')
|
||||
|
||||
Reference in New Issue
Block a user