Skip to content

Commit

Permalink
Gradle build cleanup (#3516)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Feb 7, 2025
1 parent c2c1372 commit 404b670
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 81 deletions.
63 changes: 17 additions & 46 deletions java/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,78 +1,49 @@
// Copyright (c) ZeroC, Inc.
# Copyright (c) ZeroC, Inc.

//
// Version used in JAR files
//
# Version used in JAR files
iceVersion = 3.8.0-alpha.0

//
// Select an installation base directory. The directory will be created
# Select an installation base directory. The directory will be created
// if it does not exist. If this property is not set the default will be
// used. Default values are:
// - Windows: %SystemDrive%\Ice-${iceVersion}
// - Non Windows /opt/Ice-${iceVersion}
//
prefix =

//
// Used to set --release
//
# Used to set --release
targetJavaRelease = 17

//
// Define debug as true if you want to build with debug information,
// false otherwise.
//
# Define debug as true if you want to build with debug information, false otherwise.
debug = true

//
// The Jgoodies third party package versions to use with IceGridGUI builds.
//
# The Jgoodies third party package versions to use with IceGridGUI builds.
jgoodiesLooksVersion = 2.7.0
jgoodiesFormsVersion = 1.9.0

//
// Enable this property to build IceGridGUI with JavaFX support. JavaFX is used for rendering the metrics graph.
//
# Enable this property to build IceGridGUI with JavaFX support. JavaFX is used for rendering the metrics graph.
iceGridGuiUseJavaFX = true

//
// The OpenJFX version to use with IceGridGUI builds
//
# The OpenJFX version to use with IceGridGUI builds
openjfxVersion = 11.0.2

//
// Set to true if you want IceGridGUI build to create a standalone JAR
// using proguard.
//
# Set to true if you want IceGridGUI build to create a standalone JAR using proguard.
icegridguiProguard = true

//
// Windows specific options
//
# Windows specific options

//
// The platform uses by the C++ builds, supported values are `x64` and
// `Win32`, that is required to locate the slice2java compiler in the
// platform depend directory.
//
# The platform uses by the C++ builds, supported values are `x64` and `Win32`, that is required to locate the
# slice2java compiler in the platform depend directory.
cppPlatform =

//
// The configuration uses by the C++ builds, supported values are `Debug`
// and `Release`, that is required to locate the slice2java compiler in
// the configuration depend
// directory.
//
# The configuration uses by the C++ builds, supported values are `Debug` and `Release`, that is required to locate the
# slice2java compiler in the configuration depend directory.
cppConfiguration =

//
// Gradle build properties
//
# Gradle build properties

org.gradle.daemon = true
org.gradle.parallel = true

//
// Package build properties
//
# Package build properties
DESTDIR =
17 changes: 3 additions & 14 deletions java/gradle/ice.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spotless {

// We use google-java-format to format our Java code. We also set reorderImports and formatJavadoc to true to
// match the default behavior of the google-java-format tool.
// When updating the versio be sure to update the version in `.vscode/settings.json` as well.
// When updating the version be sure to update the version in `.vscode/settings.json` as well.
googleJavaFormat("1.24.0").aosp().reorderImports(true).formatJavadoc(true)
formatAnnotations()
}
Expand All @@ -64,9 +64,6 @@ if(!(project.hasProperty('android') && project.android.sourceSets)) {
}
}

// Determine the name of the Slice-to-Java translator
def isWindows = System.properties['os.name'].toLowerCase().contains('windows')

// If the prefix isn't set use these default locations.
if(!prefix) {
def prefixVersion = iceVersion
Expand All @@ -75,18 +72,15 @@ if(!prefix) {
} else if(prefixVersion.indexOf(".0-beta")){
prefixVersion = prefixVersion.replace(".0-beta", "b")
}
if(isWindows) {
if(System.properties['os.name'].toLowerCase().contains('windows')) {
prefix = "C:\\Ice-${prefixVersion}"
} else {
prefix = "/opt/Ice-${prefixVersion}"
}
}

// Installation location for jar/pom & executables.
//
// Note that we exclude /usr/src/packages because it's the RPM build directory on SLES.
//
if((prefix.startsWith("/usr") || prefix.startsWith("/usr/local")) && !prefix.startsWith("/usr/src/packages")) {
if((prefix.startsWith("/usr") || prefix.startsWith("/usr/local"))) {
ext.jarDir = prefix + "/share/java"
ext.binDir = prefix + "/bin"
} else {
Expand All @@ -95,8 +89,3 @@ if((prefix.startsWith("/usr") || prefix.startsWith("/usr/local")) && !prefix.sta
}

ext.libDir = "$rootProject.projectDir/lib"

// Used for the tests
ext.localDependency = { artifactId ->
return project(":${artifactId}")
}
2 changes: 1 addition & 1 deletion java/gradle/library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ task installJars(type: Copy, dependsOn: jarSources) {
from "${libDir}/${project.name}-${project.version}-sources.jar"
into "${DESTDIR}${jarDir}"
}
install.dependsOn installJars
task install(dependsOn: installJars)
3 changes: 0 additions & 3 deletions java/gradle/maven-publish.publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,3 @@ signing {
}
sign configurations.archives
}

// This task is for compatibility with the old 'maven' plugin that provides an install task
task install {}
4 changes: 0 additions & 4 deletions java/test/android/controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ android {

buildTypes {
debug {
//
// Set minifyEnabled to false because the test app loads classes dynamically.
//
minifyEnabled false
}

release {
//
// Set minifyEnabled to false because the test app loads classes dynamically.
//
minifyEnabled false
}
}
Expand Down
18 changes: 6 additions & 12 deletions java/test/android/controller/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@
# Version used in JAR files
iceVersion = 3.8.0-alpha.0

# Set iceHome to location of Ice installation if Ice was installed in a
# non-standard location. You must use forward slashes in the path, even on
# Windows.
#
# iceHome =

# Gradle build properties
org.gradle.daemon = true
org.gradle.configureondemand=false

# Windows specific options

# The platform used by the C++ build. Supported values are `x64` and `Win32`.
# This is required to locate the slice2java compiler in the platform-dependent
# directory.
# The platform used by the C++ build. Supported values are `x64` and `Win32`. This is required to locate the slice2java
# compiler in the platform-dependent directory.
cppPlatform = x64

# The configuration used by the C++ build. Supported values are `Debug` and `Release`.
# This is required to locate the slice2java compiler in the configuration-dependent
# directory.
# The configuration used by the C++ build. Supported values are `Debug` and `Release`. This is required to locate the
#slice2java compiler in the configuration-dependent directory.
cppConfiguration = Debug

# TODO are this properties still needed?
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion java/test/plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
javadoc.enabled = false

dependencies {
implementation localDependency('ice')
implementation project(":ice")
}

jar {
Expand Down

0 comments on commit 404b670

Please sign in to comment.