refactor: add semicolons and spaces -> tabs in gradle scripts

This commit is contained in:
TopchetoEU 2024-12-13 02:33:01 +02:00
parent 2ed7959088
commit 5346b8917d
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
2 changed files with 75 additions and 75 deletions

View File

@ -1,67 +1,68 @@
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
plugins { plugins {
id 'application' id 'application';
id 'com.github.node-gradle.node' version '5.0.0' id 'com.github.node-gradle.node' version '5.0.0';
id 'net.nemerosa.versioning' version '2.15.0' id 'net.nemerosa.versioning' version '2.15.0';
id 'org.ajoberstar.grgit' version '5.0.0-rc.3' // required by gradle id 'org.ajoberstar.grgit' version '5.0.0-rc.3'; // required by gradle
// TODO: figure out how to integrate proguard // TODO: figure out how to integrate proguard
// id "com.github.xaverkapeller.proguard-annotations" // id "com.github.xaverkapeller.proguard-annotations"
} }
base.archivesName = project.project_name base.archivesName = project.project_name;
version = project.project_version version = project.project_version;
group = project.project_group group = project.project_group;
description = 'ES5-compliant JavaScript interpreter' description = 'ES5-compliant JavaScript interpreter';
node { node {
version = '20.0.0' version = '20.0.0';
npmVersion = '8.0.0' npmVersion = '8.0.0';
download = true download = true;
} }
task compileEnv(type: NpmTask) { task compileEnv(type: NpmTask) {
inputs.files('rollup.config.js') inputs.files('rollup.config.js');
inputs.dir('src/lib/libs') inputs.dir('src/lib/libs');
outputs.files("build/js/env.js") outputs.files("build/js/env.js");
// group = 'build' // group = 'build'
args = ['run', 'build-env'] args = ['run', 'build-env'];
} }
task compileTypescript(type: NpmTask) { task compileTypescript(type: NpmTask) {
inputs.files('rollup.config.js') inputs.files('rollup.config.js');
inputs.dir('src/lib/ts') inputs.dir('src/lib/ts');
outputs.files("build/js/ts.js") outputs.files("build/js/ts.js");
environment.put("NODE_OPTIONS", "--max-old-space-size=4096") // nom nom tasty ram
environment.put("NODE_OPTIONS", "--max-old-space-size=4096");
// group = 'build' // group = 'build'
args = ['run', 'build-ts'] args = ['run', 'build-ts'];
} }
repositories { repositories {
mavenCentral() mavenCentral();
} }
dependencies { dependencies {
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2' annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2';
compileOnly 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2' compileOnly 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2';
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2';
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testRuntimeOnly 'org.junit.platform:junit-platform-launcher';
} }
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17;
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17;
toolchain { toolchain {
languageVersion = JavaLanguageVersion.of(17) languageVersion = JavaLanguageVersion.of(17);
} }
} }
configure([tasks.compileJava]) { configure([tasks.compileJava]) {
options.release = 8 options.release = 8;
} }
jar { jar {
@ -72,20 +73,20 @@ jar {
'Build-Branch': versioning.info.branch, 'Build-Branch': versioning.info.branch,
'Build-Revision': versioning.info.commit, 'Build-Revision': versioning.info.commit,
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})", 'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-Author': 'TopchetoEU' 'Build-Author': 'TopchetoEU',
) );
} }
} }
application { application {
mainClass = project.main_class mainClass = project.main_class;
applicationDefaultJvmArgs = ['-Xmx2G', '-Xms2G', '-server', '-Dfile.encoding=UTF-8'] applicationDefaultJvmArgs = ['-Xmx2G', '-Xms2G', '-server', '-Dfile.encoding=UTF-8'];
} }
distZip { distZip {
eachFile { file -> eachFile { file ->
if (file.path.contains('bin')) { if (file.path.contains('bin')) {
file.exclude() file.exclude();
} }
} }
} }
@ -93,31 +94,31 @@ distZip {
distTar { distTar {
eachFile { file -> eachFile { file ->
if (file.path.contains('bin')) { if (file.path.contains('bin')) {
file.exclude() file.exclude();
} }
} }
} }
processResources { processResources {
dependsOn compileEnv dependsOn compileEnv;
dependsOn compileTypescript dependsOn compileTypescript;
from("build/js") { from("build/js") {
into "lib" into "lib";
} }
filesMatching "metadata.json", { filesMatching "metadata.json", {
expand( expand(
version: project.project_version, version: project.project_version,
name: project.project_name name: project.project_name,
) );
} }
} }
test { test {
useJUnitPlatform() useJUnitPlatform();
} }
wrapper { wrapper {
gradleVersion = '8.10' gradleVersion = '8.10';
} }

View File

@ -1,13 +1,12 @@
pluginManagement { pluginManagement {
repositories { repositories {
mavenCentral() mavenCentral();
gradlePluginPortal() gradlePluginPortal();
} }
} }
plugins { plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0';
} }
rootProject.name = properties.project_name;
rootProject.name = properties.project_name