diff --git a/.github/workflows/natives.yml b/.github/workflows/natives.yml index f908574b..676b17ba 100644 --- a/.github/workflows/natives.yml +++ b/.github/workflows/natives.yml @@ -32,10 +32,18 @@ jobs: - uses: gradle/actions/wrapper-validation@v4 + - name: install libxt-dev + if: matrix.os == 'ubuntu' + run: sudo apt install libxt-dev + - name: install libgtk-3-dev if: matrix.os == 'ubuntu' run: sudo apt install libgtk-3-dev + - name: install g++-aarch64-linux-gnu + if: matrix.os == 'ubuntu' + run: sudo apt install g++-aarch64-linux-gnu + - name: Setup Java 11 uses: actions/setup-java@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index e24a6398..166c56d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,19 @@ FlatLaf Change Log - Tree: Support wide cell renderer. (issue #922) - Extras: `FlatSVGIcon` color filters now can access painting component to implement component state based color mappings. (issue #906) +- Linux: Added `libflatlaf-linux-arm64.so` for Linux on ARM64. (issue #899) + +#### Fixed bugs + +- Button: Fixed background and foreground colors for `borderless` and + `toolBarButton` style default buttons (`JButton.isDefaultButton()` is `true`). + (issue #947) +- FileChooser: Improved performance when navigating to large directories with + thousands of files. (issue #953) +- PopupFactory: Fixed NPE on Windows 10 when `owner` is `null`. (issue #952) +- FlatLaf window decorations: Minimize and maximize icons were not shown for + custom scale factors less than 100% (e.g. `-Dflatlaf.uiScale=75%`). (issue + #951) ## 3.5.4 diff --git a/README.md b/README.md index fe7dfefa..514b72db 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,9 @@ Sponsors ### Current Sponsors -[![None Sponsors](images/none-sponsors.png)](https://www.formdev.com/flatlaf/sponsor/) +Exocharts + + [Become a Sponsor](https://www.formdev.com/flatlaf/sponsor/) diff --git a/flatlaf-core/build.gradle.kts b/flatlaf-core/build.gradle.kts index 11dd19b7..f02a413d 100644 --- a/flatlaf-core/build.gradle.kts +++ b/flatlaf-core/build.gradle.kts @@ -156,5 +156,6 @@ flatlafPublish { NativeArtifact( "${natives}/libflatlaf-macos-arm64.dylib", "macos-arm64", "dylib" ), NativeArtifact( "${natives}/libflatlaf-macos-x86_64.dylib", "macos-x86_64", "dylib" ), NativeArtifact( "${natives}/libflatlaf-linux-x86_64.so", "linux-x86_64", "so" ), + NativeArtifact( "${natives}/libflatlaf-linux-arm64.so", "linux-arm64", "so" ), ) } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java index 99625d75..a4fd835d 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowCloseIcon.java @@ -63,7 +63,7 @@ public class FlatWindowCloseIcon int iy = y + ((height - iwh) / 2); int ix2 = ix + iwh - 1; int iy2 = iy + iwh - 1; - float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor; + float thickness = Math.max( SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor, 1 ); Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD, 4 ); path.moveTo( ix, iy ); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java index 35d32c20..e7d11cda 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowIconifyIcon.java @@ -38,7 +38,7 @@ public class FlatWindowIconifyIcon @Override protected void paintIconAt1x( Graphics2D g, int x, int y, int width, int height, double scaleFactor ) { int iw = (int) (getSymbolHeight() * scaleFactor); - int ih = (int) scaleFactor; + int ih = Math.max( (int) scaleFactor, 1 ); int ix = x + ((width - iw) / 2); int iy = y + ((height - ih) / 2); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java index f95f379d..a731c21b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowMaximizeIcon.java @@ -42,7 +42,7 @@ public class FlatWindowMaximizeIcon int iwh = (int) (getSymbolHeight() * scaleFactor); int ix = x + ((width - iwh) / 2); int iy = y + ((height - iwh) / 2); - float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor; + float thickness = Math.max( SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor, 1 ); int arc = Math.max( (int) (1.5 * scaleFactor), 2 ); g.fill( SystemInfo.isWindows_11_orLater diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java index da2e18bb..4e216495 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatWindowRestoreIcon.java @@ -45,7 +45,7 @@ public class FlatWindowRestoreIcon int iwh = (int) (getSymbolHeight() * scaleFactor); int ix = x + ((width - iwh) / 2); int iy = y + ((height - iwh) / 2); - float thickness = SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor; + float thickness = Math.max( SystemInfo.isWindows_11_orLater ? (float) scaleFactor : (int) scaleFactor, 1 ); int arc = Math.max( (int) (1.5 * scaleFactor), 2 ); int arcOuter = (int) (arc + (1.5 * scaleFactor)); diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java index 41691c1b..db9f6838 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java @@ -653,7 +653,8 @@ public class FlatButtonUI } protected Color getBackground( JComponent c ) { - boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c ); + boolean def = isDefaultButton( c ); + boolean toolBarButton = !def && (isToolBarButton( c ) || isBorderlessButton( c )); // selected state if( ((AbstractButton)c).isSelected() ) { @@ -681,7 +682,6 @@ public class FlatButtonUI toolbarPressedBackground ); } - boolean def = isDefaultButton( c ); return buttonStateColor( c, getBackgroundBase( c, def ), disabledBackground, @@ -733,7 +733,8 @@ public class FlatButtonUI protected Color getForeground( JComponent c ) { Color fg = c.getForeground(); - boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c ); + boolean def = isDefaultButton( c ); + boolean toolBarButton = !def && (isToolBarButton( c ) || isBorderlessButton( c )); // selected state if( ((AbstractButton)c).isSelected() ) { @@ -759,7 +760,6 @@ public class FlatButtonUI toolbarPressedForeground ); } - boolean def = isDefaultButton( c ); return buttonStateColor( c, getForegroundBase( c, def ), disabledText, diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java index 59f360ad..9f88aee7 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatFileChooserUI.java @@ -376,31 +376,68 @@ public class FlatFileChooserUI if( icon != null ) return icon; - // get system icon - if( f != null ) { - try { - icon = getFileChooser().getFileSystemView().getSystemIcon( f ); - } catch( NullPointerException ex ) { - // Java 21 may throw a NPE for exe files that use default Windows exe icon - } + // new proxy icon + // + // Note: Since this is a super light weight icon object, we do not add it + // to the icon cache here. This keeps cache small in case of large directories + // with thousands of files when icons of all files are only needed to compute + // the layout of list/table, but never painted because located outside of visible area. + // When an icon needs to be painted, the proxy adds it to the icon cache + // and loads the real icon. + return new FlatFileViewIcon( f ); + } - if( icon != null ) { - if( icon instanceof ImageIcon ) - icon = new ScaledImageIcon( (ImageIcon) icon ); - cacheIcon( f, icon ); - return icon; - } + //---- class FlatFileViewIcon ----------------------------------------- + + /** + * A proxy icon that has a fixed (scaled) width/height (16x16) and + * gets/loads the real (system) icon only for painting. + * Avoids unnecessary getting/loading system icons. + */ + private class FlatFileViewIcon + implements Icon + { + private final File f; + private Icon realIcon; + + FlatFileViewIcon( File f ) { + this.f = f; } - // get default icon - icon = super.getIcon( f ); - - if( icon instanceof ImageIcon ) { - icon = new ScaledImageIcon( (ImageIcon) icon ); - cacheIcon( f, icon ); + @Override + public int getIconWidth() { + return UIScale.scale( 16 ); } - return icon; + @Override + public int getIconHeight() { + return UIScale.scale( 16 ); + } + + @Override + public void paintIcon( Component c, Graphics g, int x, int y ) { + // get icon on demand + if( realIcon == null ) { + // get system icon + try { + if( f != null ) + realIcon = getFileChooser().getFileSystemView().getSystemIcon( f ); + } catch( NullPointerException ex ) { + // Java 21 may throw a NPE for exe files that use default Windows exe icon + } + + // get default icon + if( realIcon == null ) + realIcon = FlatFileView.super.getIcon( f ); + + if( realIcon instanceof ImageIcon ) + realIcon = new ScaledImageIcon( (ImageIcon) realIcon ); + + cacheIcon( f, this ); + } + + realIcon.paintIcon( c, g, x, y ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeLibrary.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeLibrary.java index 3c169c28..a9768cd4 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeLibrary.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeLibrary.java @@ -90,10 +90,10 @@ class FlatNativeLibrary classifier = SystemInfo.isAARCH64 ? "macos-arm64" : "macos-x86_64"; ext = "dylib"; - } else if( SystemInfo.isLinux && SystemInfo.isX86_64 ) { - // Linux: requires x86_64 + } else if( SystemInfo.isLinux && (SystemInfo.isX86_64 || SystemInfo.isAARCH64)) { + // Linux: requires x86_64 or aarch64 - classifier = "linux-x86_64"; + classifier = SystemInfo.isAARCH64 ? "linux-arm64" : "linux-x86_64"; ext = "so"; // Load libjawt.so (part of JRE) explicitly because it is not found diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java index c5621132..7ab53ece 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java @@ -138,7 +138,7 @@ public class FlatPopupFactory // create drop shadow popup Popup popupForScreenOfOwner = getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ); - GraphicsConfiguration gc = owner.getGraphicsConfiguration(); + GraphicsConfiguration gc = (owner != null) ? owner.getGraphicsConfiguration() : null; return (gc != null && gc.isTranslucencyCapable()) ? new DropShadowPopup( popupForScreenOfOwner, owner, contents ) : new NonFlashingPopup( popupForScreenOfOwner, owner, contents ); @@ -306,7 +306,7 @@ public class FlatPopupFactory break; } } - if( gc == null ) + if( gc == null && owner != null ) gc = owner.getGraphicsConfiguration(); if( gc == null ) return null; diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/libflatlaf-linux-arm64.so b/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/libflatlaf-linux-arm64.so new file mode 100644 index 00000000..c1a663f3 Binary files /dev/null and b/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/libflatlaf-linux-arm64.so differ diff --git a/flatlaf-natives/flatlaf-natives-linux/README.md b/flatlaf-natives/flatlaf-natives-linux/README.md index 0b1cf98b..0fcc9877 100644 --- a/flatlaf-natives/flatlaf-natives-linux/README.md +++ b/flatlaf-natives/flatlaf-natives-linux/README.md @@ -5,12 +5,15 @@ This sub-project contains the source code for the FlatLaf Linux native library. The native library can be built only on Linux and requires a C++ compiler. +The native library is available for following CPU architectures: `x86_64` (or +`amd64`) and `arm64` (or `aarch64`). + To be able to build FlatLaf on any platform, and without C++ compiler, the -pre-built native library is checked into Git at +pre-built native libraries are checked into Git at [flatlaf-core/src/main/resources/com/formdev/flatlaf/natives/](https://github.com/JFormDesigner/FlatLaf/tree/main/flatlaf-core/src/main/resources/com/formdev/flatlaf/natives). -The native library was built on a GitHub server with the help of GitHub Actions. -See: +The native libraries were built on a GitHub server with the help of GitHub +Actions. See: [Native Libraries](https://github.com/JFormDesigner/FlatLaf/actions/workflows/natives.yml) workflow. Then the produced Artifacts ZIP was downloaded and the native library checked into Git. @@ -18,20 +21,28 @@ checked into Git. ## Development -To build the library on Linux, some packages needs to be installed. +To build the library on Linux, some packages needs to be installed: + +- `build-essential` - GCC and development tools +- `libxt-dev` - X11 toolkit development headers +- `libgtk-3-dev` - GTK 3 toolkit development headers +- `g++-aarch64-linux-gnu` - GNU C++ compiler for the arm64 architecture (only on + x86_64 Linux for cross-compiling for arm64 architecture) ### Ubuntu -`build-essential` contains GCC and development tools. `libxt-dev` contains the -X11 toolkit development headers. `libgtk-3-dev` contains the GTK toolkit -development headers. - ~~~ sudo apt update sudo apt install build-essential libxt-dev libgtk-3-dev ~~~ +Only on x86_64 Linux for cross-compiling for arm64 architecture: + +~~~ +sudo apt install g++-aarch64-linux-gnu +~~~ + ### Fedora diff --git a/flatlaf-natives/flatlaf-natives-linux/build.gradle.kts b/flatlaf-natives/flatlaf-natives-linux/build.gradle.kts index f14fb260..9ddee01b 100644 --- a/flatlaf-natives/flatlaf-natives-linux/build.gradle.kts +++ b/flatlaf-natives/flatlaf-natives-linux/build.gradle.kts @@ -30,11 +30,14 @@ flatlafJniHeaders { } library { - targetMachines = listOf( machines.linux.x86_64 ) + targetMachines = listOf( + machines.linux.x86_64, + machines.linux.architecture( "aarch64" ), + ) } var javaHome = System.getProperty( "java.home" ) -if( javaHome.endsWith( "jre" ) ) +if( javaHome.endsWith( "jre" ) && !file( "${javaHome}/include" ).exists() ) javaHome += "/.." tasks { @@ -42,8 +45,16 @@ tasks { group = "build" description = "Builds natives" - if( org.gradle.internal.os.OperatingSystem.current().isLinux ) - dependsOn( "linkRelease" ) + if( org.gradle.internal.os.OperatingSystem.current().isLinux ) { + val osArch = System.getProperty( "os.arch" ) + if( osArch == "amd64" ) { + dependsOn( "linkReleaseX86-64" ) + if( file( "/usr/bin/aarch64-linux-gnu-gcc" ).exists() ) + dependsOn( "linkCrossAarch64" ) + } + if( osArch == "aarch64" ) + dependsOn( "linkReleaseAarch64" ) + } } withType().configureEach { @@ -90,7 +101,7 @@ tasks { onlyIf { name.contains( "Release" ) } val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" ) - val libraryName = "libflatlaf-linux-x86_64.so" + val libraryName = if( name.contains( "X86-64" ) ) "libflatlaf-linux-x86_64.so" else "libflatlaf-linux-arm64.so" val jawt = "jawt" var jawtPath = "${javaHome}/lib" if( JavaVersion.current() == JavaVersion.VERSION_1_8 ) @@ -108,31 +119,103 @@ tasks { copy { from( linkedFile ) into( nativesDir ) - rename( "libflatlaf-natives-linux.so", libraryName ) + rename( linkedFile.get().asFile.name, libraryName ) } -/*dump - val dylib = linkedFile.asFile.get() - val dylibDir = dylib.parent - exec { commandLine( "size", dylib ) } - exec { - commandLine( "objdump", - // commands - "--archive-headers", - "--section-headers", - "--private-headers", - "--reloc", - "--dynamic-reloc", - "--syms", - // options -// "--private-header", - // files - dylib ) - standardOutput = FileOutputStream( "$dylibDir/objdump.txt" ) +// dump( linkedFile.asFile.get(), true ) + } + } + + if( org.gradle.internal.os.OperatingSystem.current().isLinux && + System.getProperty( "os.arch" ) == "amd64" && + file( "/usr/bin/aarch64-linux-gnu-gcc" ).exists() ) + { + register( "compileCrossAarch64Cpp" ) { + val include = layout.projectDirectory.dir( "src/main/headers" ) + val src = layout.projectDirectory.dir( "src/main/cpp" ) + workingDir = file( layout.buildDirectory.dir( "obj/main/release/aarch64-cross" ) ) + + doFirst { + workingDir.mkdirs() + } + + commandLine = listOf( + "aarch64-linux-gnu-gcc", + "-c", + "-fPIC", + "-fvisibility=hidden", + "-O3", + "-I", "${javaHome}/include", + "-I", "${javaHome}/include/linux", + "-I", "$include", + + "$src/ApiVersion.cpp", + "$src/X11WmUtils.cpp", + ) + } + + register( "linkCrossAarch64" ) { + dependsOn( "compileCrossAarch64Cpp" ) + + val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" ) + val libraryName = "libflatlaf-linux-arm64.so" + val outDir = file( layout.buildDirectory.dir( "lib/main/release/aarch64-cross" ) ) + val objDir = file( layout.buildDirectory.dir( "obj/main/release/aarch64-cross" ) ) + + doFirst { + outDir.mkdirs() + } + + commandLine = listOf( + "aarch64-linux-gnu-gcc", + "-shared", + "-Wl,-soname,$libraryName", + "-o", "$outDir/$libraryName", + + "$objDir/ApiVersion.o", + "$objDir/X11WmUtils.o", + + "-L${layout.projectDirectory}/lib/aarch64", + "-ljawt", + ) + + doLast { + // copy shared library to flatlaf-core resources + copy { + from( "$outDir/$libraryName" ) + into( nativesDir ) + } + +// dump( file( "$outDir/$libraryName" ), false ) } - exec { commandLine( "objdump", "--disassemble-all", dylib ); standardOutput = FileOutputStream( "$dylibDir/disassemble.txt" ) } - exec { commandLine( "objdump", "--full-contents", dylib ); standardOutput = FileOutputStream( "$dylibDir/full-contents.txt" ) } -dump*/ } } } + +/*dump +interface InjectedExecOps { @get:Inject val execOps: ExecOperations } +val injected = project.objects.newInstance() + +fun dump( dylib: File, disassemble: Boolean ) { + + val dylibDir = dylib.parent + injected.execOps.exec { commandLine( "size", dylib ); standardOutput = FileOutputStream( "$dylibDir/size.txt" ) } + injected.execOps.exec { + commandLine( "objdump", + // commands + "--archive-headers", + "--section-headers", + "--private-headers", + "--reloc", + "--dynamic-reloc", + "--syms", + // files + dylib ) + standardOutput = FileOutputStream( "$dylibDir/objdump.txt" ) + } + if( disassemble ) + injected.execOps.exec { commandLine( "objdump", "--disassemble-all", dylib ); standardOutput = FileOutputStream( "$dylibDir/disassemble.txt" ) } + injected.execOps.exec { commandLine( "objdump", "--full-contents", dylib ); standardOutput = FileOutputStream( "$dylibDir/full-contents.txt" ) } + injected.execOps.exec { commandLine( "hexdump", dylib ); standardOutput = FileOutputStream( "$dylibDir/hexdump.txt" ) } +} +dump*/ diff --git a/flatlaf-natives/flatlaf-natives-linux/lib/README.md b/flatlaf-natives/flatlaf-natives-linux/lib/README.md new file mode 100644 index 00000000..f0f72077 --- /dev/null +++ b/flatlaf-natives/flatlaf-natives-linux/lib/README.md @@ -0,0 +1,4 @@ +Contains libraries used to compile FlatLaf native libraries. + +- `aarch64/libjawt.so` is `/lib/libjawt.so` from Eclipse Temurin 11.0.25+9 aarch64, + which is required to cross build aarch64/arm64 .so on x86_64 diff --git a/flatlaf-natives/flatlaf-natives-linux/lib/aarch64/libjawt.so b/flatlaf-natives/flatlaf-natives-linux/lib/aarch64/libjawt.so new file mode 100644 index 00000000..1c03d7df Binary files /dev/null and b/flatlaf-natives/flatlaf-natives-linux/lib/aarch64/libjawt.so differ diff --git a/flatlaf-natives/flatlaf-natives-macos/build.gradle.kts b/flatlaf-natives/flatlaf-natives-macos/build.gradle.kts index 3f943a57..22e91318 100644 --- a/flatlaf-natives/flatlaf-natives-macos/build.gradle.kts +++ b/flatlaf-natives/flatlaf-natives-macos/build.gradle.kts @@ -43,6 +43,9 @@ var javaHome = System.getProperty( "java.home" ) if( javaHome.endsWith( "jre" ) ) javaHome += "/.." +interface InjectedExecOps { @get:Inject val execOps: ExecOperations } +val injected = project.objects.newInstance() + tasks { register( "build-natives" ) { group = "build" @@ -95,21 +98,21 @@ tasks { doLast { // sign shared library -// exec { commandLine( "codesign", "-s", "FormDev Software GmbH", "--timestamp", "${linkedFile.asFile.get()}" ) } +// injected.execOps.exec { commandLine( "codesign", "-s", "FormDev Software GmbH", "--timestamp", "${linkedFile.asFile.get()}" ) } // copy shared library to flatlaf-core resources copy { from( linkedFile ) into( nativesDir ) - rename( "libflatlaf-natives-macos.dylib", libraryName ) + rename( linkedFile.get().asFile.name, libraryName ) } /*dump val dylib = linkedFile.asFile.get() val dylibDir = dylib.parent - exec { commandLine( "size", dylib ) } - exec { commandLine( "size", "-m", dylib ) } - exec { + injected.execOps.exec { commandLine( "size", dylib ); standardOutput = FileOutputStream( "$dylibDir/size.txt" ) } + injected.execOps.exec { commandLine( "size", "-m", dylib ); standardOutput = FileOutputStream( "$dylibDir/size-m.txt" ) } + injected.execOps.exec { commandLine( "objdump", // commands "--archive-headers", @@ -127,8 +130,8 @@ tasks { dylib ) standardOutput = FileOutputStream( "$dylibDir/objdump.txt" ) } - exec { commandLine( "objdump", "--disassemble-all", dylib ); standardOutput = FileOutputStream( "$dylibDir/disassemble.txt" ) } - exec { commandLine( "objdump", "--full-contents", dylib ); standardOutput = FileOutputStream( "$dylibDir/full-contents.txt" ) } + injected.execOps.exec { commandLine( "objdump", "--disassemble-all", dylib ); standardOutput = FileOutputStream( "$dylibDir/disassemble.txt" ) } + injected.execOps.exec { commandLine( "objdump", "--full-contents", dylib ); standardOutput = FileOutputStream( "$dylibDir/full-contents.txt" ) } dump*/ } } diff --git a/flatlaf-natives/flatlaf-natives-windows/README.md b/flatlaf-natives/flatlaf-natives-windows/README.md index c164e381..f8504fb8 100644 --- a/flatlaf-natives/flatlaf-natives-windows/README.md +++ b/flatlaf-natives/flatlaf-natives-windows/README.md @@ -8,8 +8,8 @@ The native library can be built only on Windows and requires a C++ compiler. Tested with Microsoft Visual C++ (MSVC) 2019 and 2022 (comes with Visual Studio 2019 and 2022). -The native library is available for folloging CPU architectures: `x86_64` (or -`amd64`), `x86` and `arm64`. +The native library is available for following CPU architectures: `x86_64` (or +`amd64`), `x86` and `arm64` (or `aarch64`). To be able to build FlatLaf on any platform, and without C++ compiler, the pre-built DLLs are checked into Git at diff --git a/flatlaf-natives/flatlaf-natives-windows/build.gradle.kts b/flatlaf-natives/flatlaf-natives-windows/build.gradle.kts index a0893c8c..3892d870 100644 --- a/flatlaf-natives/flatlaf-natives-windows/build.gradle.kts +++ b/flatlaf-natives/flatlaf-natives-windows/build.gradle.kts @@ -91,7 +91,7 @@ tasks { copy { from( linkedFile ) into( nativesDir ) - rename( "flatlaf-natives-windows.dll", libraryName ) + rename( linkedFile.get().asFile.name, libraryName ) } /*dump diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c82..cea7a793 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6d..f3b75f3b 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum