Skip to content

Commit 5164db1

Browse files
committed
jitpack builds
1 parent 30807e8 commit 5164db1

4 files changed

Lines changed: 64 additions & 3 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ target_link_libraries(SMTC4J
2222
if (MSVC)
2323
target_compile_options(SMTC4J PRIVATE /await)
2424
endif()
25+
26+
set_target_properties(SMTC4J PROPERTIES
27+
OUTPUT_NAME "SMTC4J"
28+
)

build.gradle

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = 'dev.codeman'
6-
version = '0.0.3'
6+
version = '0.0.4'
77

88
repositories {
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+
}

src/main/java/dev/codeman/smtc4j/MediaInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)