diff --git a/android_studio/_preload.lua b/android_studio/_preload.lua index 72d2054..b780247 100644 --- a/android_studio/_preload.lua +++ b/android_studio/_preload.lua @@ -21,10 +21,14 @@ function create_gradle_wrapper(wks) -- create gradle wrapper if wks.gradlewrapper then gradle = "// auto-generated by premake-android-studio\n" + local count = 0 for _, item in ipairs(wks.gradlewrapper) do gradle = (gradle .. item .. "\n") + count = count + 1 + end + if count > 0 then + io.writefile(wks.location .. "/gradle/wrapper/gradle-wrapper.properties", gradle) end - io.writefile(wks.location .. "/gradle/wrapper/gradle-wrapper.properties", gradle) end end diff --git a/example/premake5.lua b/example/premake5.lua index c19ddef..3cc0f26 100644 --- a/example/premake5.lua +++ b/example/premake5.lua @@ -2,7 +2,7 @@ require "android_studio" workspace "android_studio_example" configurations { "Debug", "Release" } - gradleversion "com.android.tools.build:gradle:7.0.0" + gradleversion "com.android.tools.build:gradle:8.0.0" location ("build") assetpacks @@ -10,6 +10,8 @@ workspace "android_studio_example" ["pack"] = "install-time", } + androidnamespace "premake.andoid.studio" + project "android_studio_example" kind "ConsoleApp" language "C++"