Skip to content

Commit 94751a6

Browse files
author
Fabio Kasper
committed
Added support for gradle
1 parent 267d7e1 commit 94751a6

File tree

13 files changed

+450
-521
lines changed

13 files changed

+450
-521
lines changed

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
# NetBeans files
1+
# NetBeans and Compiler files
2+
.gradle/*
23
build/
3-
nbproject/
44
dist/
5+
jars/
6+
nbproject/
57
build.xml
68
manifest.mf
7-
*.jar
89

910
# STAR-CCM+ files
1011
*.sim
1112
*.sim~
1213
*.simh
1314

14-
# Python files
15+
# Python files
1516
.cache
1617
.spyproject
1718
*.pyc
1819

1920
# Other files or folders
21+
.directory
2022
temp_*/
21-
*.7z
23+
*.7z

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ MacroUtils is a collection of high-level APIs in order to make your life easier
44

55
## Requires
66

7-
1. Simcenter STAR-CCM+ v2019.3 libraries. It may not run in other versions;
7+
1. Simcenter STAR-CCM+ v2019.3 libraries;
88

9-
1. If one is compiling through NetBeans, please do against JDK 11 Source/Binary format.
9+
1. Integrated development environment (IDE) supporting JDK 11 and gradle -- e.g.: NetBeans 11 or later.
1010

1111
## Need an older version?
1212

build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
def buildVersion() {
2+
3+
File javaFile = file(java.nio.file.Paths.get(rootDir.getAbsolutePath())
4+
.resolve('macroutils')
5+
.resolve('src')
6+
.resolve('macroutils')
7+
.resolve('MacroUtils.java'))
8+
9+
String rowFound = javaFile.readLines().grep(~/\s\* \@version.*/)[0]
10+
String versionFound = rowFound.split(' ').grep(~/\d{4}\.\d{1}/)[0]
11+
12+
return versionFound
13+
14+
}
15+
16+
ext {
17+
buildDate = new java.text.SimpleDateFormat("yyyyMMdd").format(new Date())
18+
buildVersion = buildVersion()
19+
jarBaseName = "${project.name}_${buildVersion}_build_${buildDate}".toLowerCase()
20+
libsFolder = file("${rootDir}/../libs_STAR-CCM+")
21+
}
22+
23+
subprojects {
24+
25+
apply plugin: 'base'
26+
apply plugin: 'java-library'
27+
28+
dependencies {
29+
compile fileTree(libsFolder.getAbsolutePath()) {
30+
include '*.jar'
31+
}
32+
}
33+
34+
jar {
35+
36+
onlyIf {
37+
!sourceSets.main.allSource.files.isEmpty()
38+
}
39+
40+
baseName "${jarBaseName}"
41+
42+
}
43+
44+
sourceSets {
45+
main.java.srcDirs 'src'
46+
}
47+
48+
}
49+
50+
//
51+
// Uncomment for debug printing
52+
//
53+
//println " Root Project: ${project.rootProject}";
54+
//println " Project name: ${project.rootProject.name}";
55+
//println " rootDir: ${project.rootDir}"
56+
//println " projectDir: ${project.projectDir}";
57+
//println " user.dir: ${System.getProperty("user.dir")}";
58+
//println " libsFolder: ${libsFolder}";
59+
//println " build version: ${buildVersion}";
60+
//println " build date: ${buildDate}";
61+
//println " JAR base name: ${jarBaseName}";

0 commit comments

Comments
 (0)