This repository was archived by the owner on Mar 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
89 lines (76 loc) · 2.57 KB
/
build.gradle
File metadata and controls
89 lines (76 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id "application"
id "io.github.jwharm.flatpak-gradle-generator" version "1.6.0"
id "com.gradleup.shadow" version "9.3.1"
}
repositories {
maven { url = "build/repository" } // used by flatpak-builder
mavenCentral()
}
dependencies {
implementation "org.java-gi:adw:0.14.1"
}
// Generate a file with all dependency urls for the offline flatpak build
tasks.flatpakGradleGenerator {
outputFile.set(file("$rootDir/data/maven-dependencies.json"))
downloadDirectory.set("build/repository")
excludeConfigurations = ['testCompileClasspath', 'testRuntimeClasspath']
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
application {
applicationName = "example"
mainClass = "org.domain.Example"
// Allow native access
applicationDefaultJvmArgs += "--enable-native-access=ALL-UNNAMED"
// Add common library directories to the library lookup path
if (Os.isFamily(Os.FAMILY_MAC))
applicationDefaultJvmArgs += [
"-Djavagi.path=/opt/homebrew/lib",
"-XstartOnFirstThread"
]
else if (Os.isFamily(Os.FAMILY_WINDOWS))
applicationDefaultJvmArgs += [
"-Djavagi.path=C:/msys64/mingw64/bin"
]
else
applicationDefaultJvmArgs += [
"-Djavagi.path=/usr/lib/x86_64-linux-gnu:/lib64:/usr/lib64:/lib:/usr/lib"
]
}
// The "devel" profile will add the "devel" CSS class to the main window.
run {
environment "PROFILE", "devel"
}
/* These tasks can be used to manually compile the blueprint files into a
* gresource bundle.
*
* Make sure that "blueprint-compiler" and "glib-compile-resources" are
* installed. They should be included in the GTK development packages for your
* operating system (for example, on Ubuntu, install the blueprint-compiler and
* libglib2.0-dev packages).
*/
tasks.register("compileBlueprints", Exec) {
def files = fileTree("src/main/blueprint") {
include "**/*.blp"
}.files
group = "build"
commandLine "blueprint-compiler",
"batch-compile",
"build/generated/ui",
"src/main/blueprint",
*files.toList().toArray()
}
tasks.register("compileResources", Exec) {
def resourceFile = "org.domain.Example.gresource"
dependsOn compileBlueprints
group = "build"
commandLine "glib-compile-resources",
"--sourcedir=build/generated/ui",
"--target=build/generated/org.domain.Example.gresource",
"data/org.domain.Example.gresource.xml"
}