[go: up one dir, main page]

Skip to content

Commit

Permalink
fix windows artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
planetis-m committed Jul 10, 2024
1 parent 2ea632a commit dffe90c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build_android.nims
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# for details about the copyright.

import std/[os, strutils, sugar]
from std/private/globs import nativeToUnixPath

type
CpuPlatform = enum
Expand Down Expand Up @@ -63,7 +64,7 @@ const
AppScreenOrientation = landscape
AppKeystorePass = "raylib"

# mode = ScriptMode.Verbose
mode = ScriptMode.Verbose

task setup, "Set up raylib project for Android":
# Create required temp directories for APK building
Expand Down Expand Up @@ -136,6 +137,11 @@ task compile, "Compile raylib project for Android":
" -d:AndroidNdk=" & AndroidNdk & " -d:" & $AndroidGlEsVersion &
" -o:" & ProjectBuildPath / "lib" / cpu.toArchName / ("lib" & ProjectLibraryName & ".so") &
" --nimcache:" & nimcacheDir().parentDir / (ProjectName & "_" & $cpu) & " " & ProjectSourceFile)
for f in listFiles(ProjectBuildPath):
echo f
echo "inside lib"
for f in listFiles(ProjectBuildPath / "lib" / AndroidCPUs[0].toArchName):
echo f
# Compile project .java code into .class (Java bytecode)
exec(JavaHome / "bin/javac" & " -verbose --source 11 --target 11 -d " & ProjectBuildPath / "obj" &
" --system " & JavaHome & " --class-path " & androidResourcePath & (when defined(windows): ";" else: ":") &
Expand All @@ -160,7 +166,7 @@ task compile, "Compile raylib project for Android":
withDir(ProjectBuildPath):
for cpu in AndroidCPUs:
exec(AndroidBuildTools / "aapt" & " add " & "bin" / (ProjectName & ".unaligned.apk") & " " &
"lib" / cpu.toArchName / ("lib" & ProjectLibraryName & ".so"))
nativeToUnixPath("lib" / cpu.toArchName / ("lib" & ProjectLibraryName & ".so")))
# Create zip-aligned APK package: bin/{ProjectName}.aligned.apk
exec(AndroidBuildTools / "zipalign" & " -p -f 4 " & unalignedApkPath & " " & alignedApkPath)
# Create signed APK package using generated Key: {ProjectName}.apk
Expand Down

0 comments on commit dffe90c

Please sign in to comment.