Merge pull request #1285 from ifarbod/vs16-compat-android

Use correct values for MinimumVisualStudioVersion in Android projects
This commit is contained in:
Samuel Surtees 2019-06-08 08:34:30 +10:00 committed by GitHub
commit 900e4b0d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 1 deletions

View File

@ -1,6 +1,7 @@
local p = premake
local suite = test.declare("test_android_project")
local vc2010 = p.vstudio.vc2010
local android = p.modules.android
--
@ -20,6 +21,48 @@
vc2010.clCompile(cfg)
end
local function preparePropertyGroup()
system "android"
local cfg = test.getconfig(prj, "Debug", platform)
vc2010.propertyGroup(cfg)
android.androidApplicationType(cfg)
end
function suite.minVisualStudioVersion_14()
preparePropertyGroup()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">
<Keyword>Android</Keyword>
<RootNamespace>MyProject</RootNamespace>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<ApplicationType>Android</ApplicationType>
<ApplicationTypeRevision>2.0</ApplicationTypeRevision>]]
end
function suite.minVisualStudioVersion_15()
p.action.set("vs2017")
preparePropertyGroup()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">
<Keyword>Android</Keyword>
<RootNamespace>MyProject</RootNamespace>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<ApplicationType>Android</ApplicationType>
<ApplicationTypeRevision>3.0</ApplicationTypeRevision>]]
end
function suite.minVisualStudioVersion_16()
p.action.set("vs2019")
preparePropertyGroup()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">
<Keyword>Android</Keyword>
<RootNamespace>MyProject</RootNamespace>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<ApplicationType>Android</ApplicationType>
<ApplicationTypeRevision>3.0</ApplicationTypeRevision>]]
end
function suite.noOptions()
prepare()
test.capture [[

View File

@ -70,7 +70,13 @@
function android.androidApplicationType(cfg)
vc2010.element("Keyword", nil, "Android")
vc2010.element("RootNamespace", nil, "%s", cfg.project.name)
vc2010.element("MinimumVisualStudioVersion", nil, "15.0") -- Use 14.0 for VS2015?
if _ACTION >= "vs2019" then
vc2010.element("MinimumVisualStudioVersion", nil, "16.0")
elseif _ACTION >= "vs2017" then
vc2010.element("MinimumVisualStudioVersion", nil, "15.0")
elseif _ACTION >= "vs2015" then
vc2010.element("MinimumVisualStudioVersion", nil, "14.0")
end
vc2010.element("ApplicationType", nil, "Android")
if _ACTION >= "vs2017" then
vc2010.element("ApplicationTypeRevision", nil, "3.0")