File tree Expand file tree Collapse file tree
src/main/java/dev/codeman/smtc4j Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Windows Native
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+ workflow_dispatch :
8+
9+ jobs :
10+ build-windows :
11+ runs-on : windows-latest
12+
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v4
16+
17+ - name : Setup JDK
18+ uses : actions/setup-java@v4
19+ with :
20+ distribution : temurin
21+ java-version : 21
22+
23+ - name : Configure CMake
24+ run : |
25+ cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Release
26+
27+ - name : Build
28+ run : |
29+ cmake --build build --config Release
30+
31+ - name : Publish DLL to GitHub Release
32+ uses : softprops/action-gh-release@v2
33+ with :
34+ files : build/Release/SMTC4J.dll
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ target_link_libraries(SMTC4J
2222if (MSVC )
2323 target_compile_options (SMTC4J PRIVATE /await )
2424endif ()
25+
26+ set_target_properties (SMTC4J PROPERTIES
27+ OUTPUT_NAME "SMTC4J"
28+ )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ plugins {
33}
44
55group = ' dev.codeman'
6- version = ' 0.0.3 '
6+ version = ' 0.0.4 '
77
88repositories {
99 mavenCentral()
@@ -17,4 +17,27 @@ java {
1717 toolchain {
1818 languageVersion = JavaLanguageVersion . of(21 )
1919 }
20- }
20+ }
21+
22+ def nativeDir = file(" $buildDir /resources/main/native" )
23+ def dllFile = file(" $nativeDir /SMTC4J.dll" )
24+
25+ tasks. register(' downloadNative' ) {
26+ doLast {
27+ if (dllFile. exists()) return
28+
29+ nativeDir. mkdirs()
30+
31+ def tag = " v$version "
32+ def url = " https://github.com/CodeManDev/SMTC4J/releases/download/${ tag} /SMTC4J.dll"
33+
34+ println " Downloading native library from $url "
35+ URI . create(url). toURL(). withInputStream { i ->
36+ dllFile. withOutputStream { it << i }
37+ }
38+ }
39+ }
40+
41+ processResources {
42+ dependsOn ' downloadNative'
43+ }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public String toString() {
1212 ", album='" + this .album + '\'' +
1313 ", duration=" + this .duration +
1414 ", sourceApp='" + this .sourceApp + '\'' +
15- ", thumbnailBase64 length: " + this .thumbnailBase64 . length () +
15+ ", thumbnailBase64 length: " + ( this .thumbnailBase64 == null ? "null" : this . thumbnailBase64 . length () ) +
1616 '}' ;
1717 }
1818
You can’t perform that action at this time.
0 commit comments