Skip to content

Commit

Permalink
[UPGRADE] Transition to up-to-date versions of JDK and Gradle (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
demid5111 authored Mar 12, 2022
1 parent 0a6d941 commit 6272202
Show file tree
Hide file tree
Showing 21 changed files with 357 additions and 363 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ out/
.idea/
build/
.gradle/
gradle.properties
gradle.properties

*.log
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/libraries/Gradle__junit_junit_4_12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions .idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_6_2.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_6_2.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/libraries/Gradle__org_mockito_mockito_core_2_6_3.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/libraries/Gradle__org_objenesis_objenesis_2_5.xml

This file was deleted.

16 changes: 3 additions & 13 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@

[![Quality Gate](https://sonarqube.com/api/badges/gate?key=dss.lingvo)](https://sonarqube.com/dashboard/index?id=dss.lingvo)

[LDSS-6] enable experts weights calculation
[LDSS-7] enable paddy corner case

**All instructions are applicable for macOS only**

### How to run

You need to provide the path to the input JSON file, containing problem description

Example launch:
`./gradlew run -PappArgs="['-i', 'PATH_TO_PROJECT_ROOT/src/main/resources/description_multilevel.json']"`

1. macOS:

```bash
./gradlew run -PappArgs="['-i', 'PATH_TO_PROJECT_ROOT/src/main/resources/description_multilevel.json', '-o', 'run.log']"
```

2. Windows:
```bash
.\gradlew run --args='-i PATH_TO_PROJECT_ROOT\src\main\resources\description_multilevel.json -o run.log'
```

### How to use as a jar

1. Build the jar with core logic and all dependencies: `./gradlew shadowJar`
2. [Optional] build the jar with sources: `./gradlew sourcesJar`
3. Both jars are placed in **build/libs** folder. *lingvo-dss-all.jar* represents core logic with dependencies.
While *lingvo-dss-sources.jar* contains sources of the library.
4. Run the jar on the given description:
```bash
java -jar .\build\libs\lingvo-dss-all.jar -i .\src\main\resources\description_multilevel.json -o run.log
```
77 changes: 19 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,80 +1,41 @@
plugins {
id 'com.github.johnrengelman.shadow' version '2.0.1'
id "org.sonarqube" version "2.2"
id 'org.openjfx.javafxplugin' version '0.0.12'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'application'
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
apply plugin: "jacoco"

mainClassName = 'dss.lingvo.Main'

// tag:repositories[]
repositories {
jcenter()
}
// end:repositories[]

// tag::jar[]
jar {
baseName = 'lingvo-dss'
version = '0.1.0'
mavenCentral()
}
// end::jar[]

// tag:dependencies[]
sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile(
implementation(
[group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.4.1'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.4.1'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.4.1'],
[group: 'commons-cli', name: 'commons-cli', version: '1.4']
[group: 'commons-cli', name: 'commons-cli', version: '1.4'],
[group: 'org.openjfx', name: 'javafx-base', version: '12'],
)

testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:2.+"
}
// end:dependencies[]

jar {
manifest {
attributes 'Main-Class': 'dss.lingvo.Main'
}
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.+"
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
javafx {
version = '12'
modules = [ 'javafx.base' ]
}


sonarqube {
properties {
property "sonar.projectName", "Linguistic Decision Support System"
property "sonar.projectKey", "dss.lingvo"
property "sonar.exclusions", "src/main/java/dss/lingvo/samples/*.java, src/main/java/dss/lingvo/utils/models/*.java"
}
ext {
javaMainClass = 'dss.lingvo.Main'
}

jacocoTestReport {
group = "Reporting"
reports {
xml.enabled true
csv.enabled false
html.destination "${buildDir}/reports/coverage"
}
application {
mainClassName = javaMainClass
}

run {
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
shadowJar {
manifest {
attributes 'Main-Class': javaMainClass
}
}

task testCov
testCov.dependsOn test
testCov.dependsOn jacocoTestReport
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Nov 16 19:13:40 MSK 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip
Loading

0 comments on commit 6272202

Please sign in to comment.