Skip to content

Commit e29467d

Browse files
committed
Updated for release 5.5.0
1 parent b82df3a commit e29467d

137 files changed

Lines changed: 2033 additions & 1655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.classpath

Lines changed: 0 additions & 50 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
.vscode
3+
.gradle/
34
jars/fluenta.jar
45
out
56
bin

.project

Lines changed: 0 additions & 28 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Fluenta is available in two modes:
1515

1616
### Source Code
1717

18-
Source code of Fluenta is free. Anyone can download the source code, compile, modify and use it at no cost in compliance with the accompanying license terms.
18+
Anyone can download the source code, compile, modify and use it at no cost in compliance with the accompanying license terms. See [licenses](licenses/README.md) directory.
1919

2020
You can subscribe to [Maxprograms Support](https://groups.io/g/maxprograms/) at Groups.io and request peer assistance for the source code version there.
2121

@@ -50,20 +50,20 @@ Ready to use installers are available at [https://www.maxprograms.com/products/f
5050
You need these tools to build Fluenta:
5151

5252
- Java 21 LTS, get it from [https://adoptium.net/](https://adoptium.net/)
53-
- Apache Ant 1.10.14, get it from [https://ant.apache.org](https://ant.apache.org)
54-
- NodeJS 22.12.0 LTS, get it it from [https://nodejs.org/](https://nodejs.org/)
53+
- Gradle 9.2, get it from [https://gradle.org/](https://gradle.org/)
54+
- NodeJS 24.14.0 LTS, get it it from [https://nodejs.org/](https://nodejs.org/)
5555

5656
### Building Fluenta
5757

5858
- Checkout this repository
5959
- Point your `JAVA_HOME` variable to JDK 21
60-
- Run `ant` to compile the Java code
60+
- Run `gradle` to compile the Java code
6161
- Install the NodeJS dependencies with `npm install`
6262

6363
```shell
6464
git clone https://github.com/rmraya/Fluenta.git
6565
cd Fluenta
66-
ant
66+
gradle
6767
npm install
6868
```
6969

@@ -74,3 +74,7 @@ After building the code, you can launch fluenta with the following command:
7474
```shell
7575
npm start
7676
```
77+
78+
## Legal
79+
80+
License information for all included components is available in the [licenses](licenses/README.md) directory.

build.gradle

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
plugins {
2+
id 'java'
3+
id 'application'
4+
}
5+
6+
defaultTasks 'dist'
7+
8+
java {
9+
sourceCompatibility = JavaVersion.VERSION_21
10+
targetCompatibility = JavaVersion.VERSION_21
11+
}
12+
13+
// No repositories needed since we're using local JARs
14+
repositories {
15+
// Empty - using local JAR files only
16+
}
17+
18+
dependencies {
19+
implementation files('jars/bcp47j.jar')
20+
implementation files('jars/json.jar')
21+
implementation files('jars/jsoup.jar')
22+
implementation files('jars/mapdb.jar')
23+
implementation files('jars/openxliff.jar')
24+
implementation files('jars/sqlite-jdbc-3.51.1.0.jar')
25+
implementation files('jars/swordfish.jar')
26+
implementation files('jars/xmljava.jar')
27+
}
28+
29+
application {
30+
mainModule = 'fluenta'
31+
mainClass = 'com.maxprograms.fluenta.Fluenta'
32+
}
33+
34+
sourceSets {
35+
main {
36+
java {
37+
srcDirs = ['src']
38+
}
39+
resources {
40+
srcDirs = ['src']
41+
exclude '**/*.java'
42+
exclude '**/*.xcf'
43+
}
44+
}
45+
}
46+
47+
compileJava {
48+
outputs.upToDateWhen { false } // Always rebuild
49+
50+
doFirst {
51+
// Create the output directory for compilation
52+
delete 'out'
53+
mkdir 'out'
54+
}
55+
56+
options.compilerArgs = ['--module-path', configurations.compileClasspath.asPath]
57+
destinationDirectory = file('out')
58+
59+
doLast {
60+
// Copy all resource files from src to out directory (everything except .java files)
61+
copy {
62+
from 'src'
63+
into 'out'
64+
exclude '**/*.java'
65+
exclude '**/*.xcf'
66+
}
67+
println "✓ Java compilation and resource copying completed"
68+
}
69+
}
70+
71+
tasks.register('createJar', Jar) {
72+
dependsOn compileJava
73+
outputs.upToDateWhen { false } // Always rebuild
74+
description = 'Build fluenta.jar file'
75+
group = 'build'
76+
archiveBaseName = 'fluenta'
77+
destinationDirectory = file('jars')
78+
from 'out'
79+
80+
doFirst {
81+
// Delete existing JAR file
82+
delete 'jars/fluenta.jar'
83+
}
84+
85+
// Include all files from out directory except Java source files
86+
include '**/*'
87+
exclude '**/*.java'
88+
exclude '**/*.xcf'
89+
90+
manifest {
91+
attributes(
92+
'Automatic-Module-Name': 'fluenta',
93+
'Module-Path': configurations.runtimeClasspath.asPath
94+
)
95+
}
96+
97+
doLast {
98+
println "✓ JAR created: ${archiveFile.get()}"
99+
}
100+
}
101+
102+
tasks.register('linkJava', Exec) {
103+
dependsOn createJar
104+
outputs.upToDateWhen { false } // Always rebuild
105+
106+
doFirst {
107+
// Clean up previous dist directory before creating new one
108+
delete 'dist'
109+
}
110+
111+
// Cross-platform file separator handling
112+
def pathSeparator = File.pathSeparator
113+
def fileSeparator = File.separator
114+
def javaHome = System.getProperty('java.home')
115+
def jmodsPath = javaHome + fileSeparator + 'jmods'
116+
def modulePath = 'jars' + pathSeparator + jmodsPath
117+
118+
// Use jlink command - works cross-platform
119+
commandLine 'jlink',
120+
'--module-path', modulePath,
121+
'--add-modules', 'fluenta',
122+
'--output', 'dist',
123+
'--verbose'
124+
125+
doLast {
126+
// Clean up jrt-fs.jar if it exists
127+
def jrtFile = file('dist/lib/jrt-fs.jar')
128+
if (jrtFile.exists()) {
129+
delete jrtFile
130+
}
131+
println "✓ Runtime image created successfully"
132+
}
133+
}
134+
135+
tasks.register('copyWindows') {
136+
dependsOn linkJava
137+
outputs.upToDateWhen { false } // Always rebuild
138+
onlyIf { System.getProperty('os.name').toLowerCase().contains('windows') }
139+
140+
doLast {
141+
// Clean up existing directories first to avoid permission issues
142+
delete 'bin', 'conf', 'include', 'legal', 'lib'
143+
delete 'release'
144+
145+
copy {
146+
from 'dist/bin'
147+
into 'bin'
148+
}
149+
copy {
150+
from 'dist/conf'
151+
into 'conf'
152+
}
153+
copy {
154+
from 'dist/include'
155+
into 'include'
156+
}
157+
copy {
158+
from 'dist/legal'
159+
into 'legal'
160+
}
161+
copy {
162+
from 'dist/lib'
163+
into 'lib'
164+
}
165+
copy {
166+
from 'dist/release'
167+
into '.'
168+
}
169+
delete 'dist'
170+
delete 'build'
171+
delete 'out'
172+
}
173+
}
174+
175+
tasks.register('copyUnix') {
176+
dependsOn linkJava
177+
outputs.upToDateWhen { false } // Always rebuild
178+
onlyIf { !System.getProperty('os.name').toLowerCase().contains('windows') }
179+
180+
doLast {
181+
// Clean up existing directories first to avoid permission issues
182+
delete 'bin', 'conf', 'include', 'legal', 'lib'
183+
delete 'release'
184+
185+
copy {
186+
from 'dist/bin'
187+
into 'bin'
188+
}
189+
copy {
190+
from 'dist/conf'
191+
into 'conf'
192+
}
193+
copy {
194+
from 'dist/include'
195+
into 'include'
196+
}
197+
copy {
198+
from 'dist/legal'
199+
into 'legal'
200+
}
201+
copy {
202+
from 'dist/lib'
203+
into 'lib'
204+
}
205+
copy {
206+
from 'dist/release'
207+
into '.'
208+
}
209+
delete 'dist'
210+
delete 'build'
211+
delete 'out'
212+
}
213+
}
214+
215+
tasks.register('dist') {
216+
dependsOn copyWindows, copyUnix
217+
outputs.upToDateWhen { false } // Always rebuild
218+
description = 'Prepare distribution'
219+
220+
doFirst {
221+
println "✓ Starting distribution build..."
222+
}
223+
224+
doLast {
225+
// Clean up JAR file after distribution is ready
226+
delete 'jars/fluenta.jar'
227+
println "✓ Distribution ready"
228+
}
229+
}
230+
231+
tasks.register('distclean', Delete) {
232+
delete 'dist', 'bin', 'conf', 'include', 'legal', 'lib', 'release'
233+
}
234+
235+
clean {
236+
delete 'out', 'build'
237+
}
238+

0 commit comments

Comments
 (0)