Skip to content

Commit

Permalink
update build.gradle
Browse files Browse the repository at this point in the history
Yinnii committed Aug 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent bf59714 commit 4fa4073
Showing 1 changed file with 5 additions and 175 deletions.
180 changes: 5 additions & 175 deletions tmitocar-service/build.gradle
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.20'
}

// java {
// toolchain {
// languageVersion = JavaLanguageVersion.of(17)
// }
// }
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
// Use JCenter for resolving dependencies.
@@ -66,11 +66,6 @@ dependencies {
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

// configurations {
// // This ensures las2peer is available in the tests, but won't be bundled
// testImplementation.extendsFrom implementation
// }

bootJar {
mainClassName = "${project.property('service.name')}.${project.property('service.class')}"
}
@@ -91,171 +86,6 @@ springBoot {
mainClassName = "${project.property('service.name')}.${project.property('service.class')}"
}


tasks.named('test') {
useJUnitPlatform()
}

// jar {
// manifest {
// attributes "Main-Class": "${project.property('service.name')}.${project.property('service.class')}"
// attributes "Library-Version": "${project.property('service.version')}"
// attributes "Library-SymbolicName": "${project.property('service.name')}"
// }

// from { (configurations.runtimeClasspath).collect { it.isDirectory() ? it : zipTree(it) } } {
// // Exclude signatures to be able to natively bundle signed jars
// exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
// }
// }

// application {
// // Define the main class for the application.
// mainClass = "${project.property('service.name')}.${project.property('service.class')}"

// group = "${project.property('service.name')}"
// archivesBaseName = group

// version = "${project.property('service.version')}"
// sourceCompatibility = "${project.property('java.version')}"
// targetCompatibility = "${project.property('java.version')}"
// }

// put all .jar files into export/jars folder
tasks.withType(Jar) {
duplicatesStrategy = 'include'
destinationDirectory = file("$projectDir/export/jars")
}

javadoc {
destinationDir = file("$projectDir/export/doc")
}

build.dependsOn "javadoc"

compileJava {
dependsOn "copyMain"
}

compileTestJava {
dependsOn "copyTest"
}

// Copies .xml files into build directory
task copyMain(type: Copy) {
from "src/main/java"
include "**/*.xml"
into "$buildDir/classes/java/main"
}

// Copies .xml files into build directory
task copyTest(type: Copy) {
from "src/test/java"
include "**/*.xml"
into "$buildDir/classes/java/test"
}

// These two tasks restore the build and runtime environment used
// in the ant environment
task copyJar(type: Copy) {
from jar // here it automatically reads jar file produced from jar task
into "$rootDir/service"
}

task copyToLib(type: Copy) {
from configurations.compileClasspath
into "$rootDir/lib"
}

build.dependsOn copyJar
build.dependsOn copyToLib

// task startscripts {
// def binDir = new File("$rootDir/bin")
// if (!binDir.exists()) {
// binDir.mkdirs()
// }
// def file = new File("$rootDir/bin/start_network.sh")
// if (!file.exists()) {
// file.createNewFile()
// }
// file.text = """#!/bin/bash

// # this script is autogenerated by 'gradle startscripts'
// # it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
// # pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh

// java -cp "lib/*" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive
// """
// def file2 = new File("$rootDir/bin/start_network.bat")
// if (!file2.exists()) {
// file2.createNewFile()
// }
// file2.text = """:: this script is autogenerated by 'gradle startscripts'
// :: it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
// :: pls execute it from the bin folder of your deployment by double-clicking on it

// %~d0
// cd %~p0
// cd ..
// set BASE=%CD%
// set CLASSPATH="%BASE%/lib/*;"
// set ADD_OPENS=--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED

// java -cp %CLASSPATH% %ADD_OPENS% i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService('${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}') startWebConnector interactive

// pause
// """
// }
//
// build.dependsOn "startscripts"

task deleteStartup {

file("$rootDir/etc/startup").deleteDir()

}

build.dependsOn "deleteStartup"

clean.doLast {
file("$rootDir/tmp").deleteDir()
file("$rootDir/lib").deleteDir()
file("$rootDir/servicebundle").deleteDir()
file("$rootDir/service").deleteDir()
file("$rootDir/etc/startup").deleteDir()
file("$projectDir/export").deleteDir()
}

task cleanAll {
dependsOn "clean"

doLast {
file("$rootDir/log").deleteDir()
file("$rootDir/node-storage").deleteDir()
}
}

test {
workingDir = file("$rootDir")
}

// Only required when using Eclipse:
// configuration for eclipse (this allows to import the project as a gradle project in eclipse without any problems)
// eclipse {
// classpath {
// file {
// whenMerged {
// // change output directory for test, main, resources and default
// def main = entries.find { it.path == "src/main/java" }
// main.output = "output/main"

// def test = entries.find { it.path == "src/test/java" }
// test.output = "output/test"

// def defaultEntry = entries.find { it.kind == "output" && it.path == "bin/default" }
// defaultEntry.path = "output/default"
// }
// }
// }
// }

0 comments on commit 4fa4073

Please sign in to comment.