Merge pull request #1203 from tempura-sukiyaki/vsandroid-javacompile
Add support for JavaCompile in vsandroid
This commit is contained in:
commit
6e380c0242
@ -1,5 +1,6 @@
|
||||
require ("android")
|
||||
|
||||
return {
|
||||
"test_android_project.lua"
|
||||
"test_android_files.lua",
|
||||
"test_android_project.lua",
|
||||
}
|
||||
|
47
modules/android/tests/test_android_files.lua
Normal file
47
modules/android/tests/test_android_files.lua
Normal file
@ -0,0 +1,47 @@
|
||||
local p = premake
|
||||
local suite = test.declare("test_android_files")
|
||||
local vc2010 = p.vstudio.vc2010
|
||||
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local wks, prj
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("vs2015")
|
||||
wks = test.createWorkspace()
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
prj = test.getproject(wks, 1)
|
||||
system "android"
|
||||
vc2010.files(prj)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Test filtering of source files into the correct categories.
|
||||
--
|
||||
|
||||
function suite.none_onJavaFile()
|
||||
files { "hello.java" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<None Include="hello.java" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.javaCompile_onJavaFile()
|
||||
kind "androidproj"
|
||||
files { "hello.java" }
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ItemGroup>
|
||||
<JavaCompile Include="hello.java" />
|
||||
</ItemGroup>
|
||||
]]
|
||||
end
|
@ -220,6 +220,19 @@
|
||||
end
|
||||
}
|
||||
|
||||
vc2010.categories.JavaCompile = {
|
||||
name = "JavaCompile",
|
||||
priority = 99,
|
||||
|
||||
emitFiles = function(prj, group)
|
||||
vc2010.emitFiles(prj, group, "JavaCompile", {vc2010.generatedFile, android.link})
|
||||
end,
|
||||
|
||||
emitFilter = function(prj, group)
|
||||
vc2010.filterGroup(prj, group, "JavaCompile")
|
||||
end
|
||||
}
|
||||
|
||||
vc2010.categories.Content = {
|
||||
name = "Content",
|
||||
priority = 99,
|
||||
@ -239,6 +252,7 @@
|
||||
end
|
||||
|
||||
local filename = path.getname(file.name):lower()
|
||||
local extension = path.getextension(filename)
|
||||
|
||||
if filename == "androidmanifest.xml" then
|
||||
return vc2010.categories.AndroidManifest
|
||||
@ -246,6 +260,8 @@
|
||||
return vc2010.categories.AntBuildXml
|
||||
elseif filename == "project.properties" then
|
||||
return vc2010.categories.AntProjectPropertiesFile
|
||||
elseif extension == ".java" then
|
||||
return vc2010.categories.JavaCompile
|
||||
else
|
||||
return vc2010.categories.Content
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user