Skip to content

Commit

Permalink
Merge pull request #77 from epam/mrjar
Browse files Browse the repository at this point in the history
Speedups
  • Loading branch information
agdavydov81 committed Jun 28, 2023
2 parents 42c1e38 + 6966aff commit 60c59e0
Show file tree
Hide file tree
Showing 27 changed files with 802 additions and 1,747 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,22 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
java-version: '19'
- name: build
run: |
./gradlew jar
./gradlew javadocJar
./gradlew copyTestJars
- uses: actions/upload-artifact@v3
with:
name: java-jars
path: |
./*java/dfp/build/libs/*
./*java/dfp-math/build/libs/*
./*java/decimalDemo/build/libs/*
./*java/dfp/testLibs/*
./*java/dfp-math/testLibs/*
./*java/dfpNativeTests/testLibs/*
./*java/vtaTest/testLibs/*
retention-days: 7

build-dotnet:
Expand Down Expand Up @@ -190,20 +194,20 @@ jobs:

test-java:
runs-on: ${{ matrix.os }}
needs: [compress-native]
needs: [build-java]
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'windows-2019', 'macos-latest']
java: [ '8', '11', '15']
java: [ '8', '11', '19']
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download compress-native artifacts
- name: Download java-jars artifacts
uses: actions/download-artifact@v3
with:
name: compress-native
name: java-jars
- name: Setup java
uses: actions/setup-java@v3
with:
Expand All @@ -214,15 +218,7 @@ jobs:
./gradlew :java:systemInfo:runSystemInfo
- name: test
run: |
./gradlew check
- name: Upload test results on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
path: |
java/dfp/build/reports/*
java/dfp-math/build/reports/*
name: Java-{{ matrix.java }}-${{ matrix.os }}-TestReports
./gradlew runTestJars
test-dotnet:
runs-on: ${{ matrix.os }}
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,22 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
java-version: '19'
- name: build
run: |
./gradlew jar
./gradlew javadocJar
./gradlew copyTestJars
- uses: actions/upload-artifact@v3
with:
name: java-jars
path: |
./*java/dfp/build/libs/*
./*java/dfp-math/build/libs/*
./*java/decimalDemo/build/libs/*
./*java/dfp/testLibs/*
./*java/dfp-math/testLibs/*
./*java/dfpNativeTests/testLibs/*
./*java/vtaTest/testLibs/*
retention-days: 7


Expand Down Expand Up @@ -236,15 +240,15 @@ jobs:

test-java:
runs-on: ubuntu-latest
needs: [compress-native]
needs: [build-java]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download compress-native artifacts
- name: Download java-jars artifacts
uses: actions/download-artifact@v3
with:
name: compress-native
name: java-jars
- name: Setup java
uses: actions/setup-java@v3
with:
Expand All @@ -255,7 +259,7 @@ jobs:
./gradlew :java:systemInfo:runSystemInfo
- name: test
run: |
./gradlew check
./gradlew runTestJars
test-dotnet:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=0.12.11-SNAPSHOT
version=1.0.0-SNAPSHOT
valueTypesVersion=0.9.4
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
33 changes: 28 additions & 5 deletions java/dfp-math/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ if (isReleaseVersion) {

group = 'com.epam.deltix'

sourceCompatibility = 1.7
compileTestJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
sourceCompatibility = 8

repositories {
mavenCentral()
Expand Down Expand Up @@ -134,3 +130,30 @@ jar {
sourcesJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

task testsJar(type: Jar, dependsOn: [jar, testClasses, processTestResources]) {
archiveClassifier = 'tests'
from sourceSets.test.output
}

task copyTestDeps(type: Copy) {
from(sourceSets.test.runtimeClasspath) { include '*.jar' }
into('testLibs')
}

task copyTestJars(type: Copy, dependsOn: [testsJar, copyTestDeps]) {
from(jar.outputs.files)
from(testsJar.outputs.files)
into('testLibs')
}

task runTestJars(type: JavaExec) {
mainClass = 'org.junit.runner.JUnitCore'
classpath = files { file('testLibs').listFiles() }

def testClassesRoot = file('src/test/java').absolutePath
fileTree(dir: testClassesRoot, include: '**/*Test.java').each { File file ->
def ap = file.absolutePath
args += ap.substring(testClassesRoot.length() + 1, ap.length() - 5).replace(File.separator, '.')
}
}
71 changes: 67 additions & 4 deletions java/dfp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,37 @@ if (isReleaseVersion) {

group = 'com.epam.deltix'

sourceCompatibility = 1.7
sourceSets {
java9 {
java {
srcDirs = ['src/main/java9']
}
}

java18 {
java {
srcDirs = ['src/main/java18']
}
}
}

compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
compileTestJava {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = 8
targetCompatibility = 8
}

compileJava9Java {
sourceCompatibility = 9
targetCompatibility = 9
}

compileJava18Java {
sourceCompatibility = 18
targetCompatibility = 18
}

repositories {
Expand All @@ -25,6 +52,9 @@ java {
}

dependencies {
java9Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava }
java18Implementation files(sourceSets.main.output.classesDirs) { builtBy compileJava }

testImplementation project(':java:testUtils')
testImplementation 'junit:junit:4.+'
testImplementation 'org.apache.commons:commons-math3:3.6.1'
Expand Down Expand Up @@ -97,8 +127,15 @@ if (isReleaseVersion) {
}

jar {
into('META-INF/versions/9') {
from sourceSets.java9.output
}
into('META-INF/versions/18') {
from sourceSets.java18.output
}
manifest {
attributes 'Implementation-Title': 'Deltix Decimal Floating-Point Arithmetic Library',
attributes 'Multi-Release': 'true',
'Implementation-Title': 'Deltix Decimal Floating-Point Arithmetic Library',
'Implementation-Version': archiveVersion,
'Main-Class': 'com.epam.deltix.dfp.Demo'
}
Expand All @@ -110,3 +147,29 @@ jar {
}
}

task testsJar(type: Jar, dependsOn: [jar, testClasses, processTestResources]) {
archiveClassifier = 'tests'
from sourceSets.test.output
}

task copyTestDeps(type: Copy) {
from(sourceSets.test.runtimeClasspath) { include '*.jar' }
into('testLibs')
}

task copyTestJars(type: Copy, dependsOn: [testsJar, copyTestDeps]) {
from(jar.outputs.files)
from(testsJar.outputs.files)
into('testLibs')
}

task runTestJars(type: JavaExec) {
mainClass = 'org.junit.runner.JUnitCore'
classpath = files { file('testLibs').listFiles() }

def testClassesRoot = file('src/test/java').absolutePath
fileTree(dir: testClassesRoot, include: '**/*Test.java').each { File file ->
def ap = file.absolutePath
args += ap.substring(testClassesRoot.length() + 1, ap.length() - 5).replace(File.separator, '.')
}
}
Loading

0 comments on commit 60c59e0

Please sign in to comment.