Skip to content

Commit

Permalink
Merge pull request cocos2d#12336 from jianglong0156/addResjs
Browse files Browse the repository at this point in the history
modify js special resource path
  • Loading branch information
pandamicro committed Jun 15, 2015
2 parents d0db40c + 10ed5e0 commit 0c1347a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build/cocos2d_js_tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/bash\ncocos_dir=${SRCROOT}/../tests/js-tests/res\nif [ -d \"${cocos_dir}\" ]; then\nrm -rv \"${cocos_dir}\"\nmkdir \"${cocos_dir}\"\nelse\nmkdir \"${cocos_dir}\"\nfi\n\ncp -r \"${SRCROOT}/../tests/cpp-tests/Resources/\" \"${cocos_dir}\"\ncp -r \"${SRCROOT}/../tests/js-tests/resjs/\" \"${cocos_dir}\"";
shellScript = "#!/bin/bash\ncocos_dir=${SRCROOT}/../tests/js-tests/res\nif [ -d \"${cocos_dir}\" ]; then\nrm -rv \"${cocos_dir}\"\nmkdir \"${cocos_dir}\"\nelse\nmkdir \"${cocos_dir}\"\nfi\n\ncp -r \"${SRCROOT}/../tests/cpp-tests/Resources/\" \"${cocos_dir}\"\ncp -r \"${SRCROOT}/../tests/js-tests/resjs/\" \"${cocos_dir}/resjs\"";
};
EDCA13EE1AEA4E7B00F445CA /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -609,7 +609,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/bash\ncocos_dir=${SRCROOT}/../tests/js-tests/res\nif [ -d \"${cocos_dir}\" ]; then\nrm -rv \"${cocos_dir}\"\nmkdir \"${cocos_dir}\"\nelse\nmkdir \"${cocos_dir}\"\nfi\n\ncp -r \"${SRCROOT}/../tests/cpp-tests/Resources/\" \"${cocos_dir}\"\ncp -r \"${SRCROOT}/../tests/js-tests/resjs/\" \"${cocos_dir}\"";
shellScript = "#!/bin/bash\ncocos_dir=${SRCROOT}/../tests/js-tests/res\nif [ -d \"${cocos_dir}\" ]; then\nrm -rv \"${cocos_dir}\"\nmkdir \"${cocos_dir}\"\nelse\nmkdir \"${cocos_dir}\"\nfi\n\ncp -r \"${SRCROOT}/../tests/cpp-tests/Resources/\" \"${cocos_dir}\"\ncp -r \"${SRCROOT}/../tests/js-tests/resjs/\" \"${cocos_dir}/resjs\"";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
1 change: 1 addition & 0 deletions tests/js-tests/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ cc.game.onStart = function(){
searchPaths.push('script');
searchPaths.push('src');
var paths = [
'res/resjs',
'res',
'res/scenetest',
'res/scenetest/ArmatureComponentTest',
Expand Down
2 changes: 1 addition & 1 deletion tests/js-tests/project/proj.android-studio/build-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"from": "../../resjs",
"to": "res/"
"to": "res/resjs/"
}
],
"ndk_module_path": [
Expand Down
2 changes: 1 addition & 1 deletion tests/js-tests/project/proj.android/build-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"from": "../../resjs",
"to": "res/"
"to": "res/resjs/"
}
],
"ndk_module_path": [
Expand Down
2 changes: 1 addition & 1 deletion tests/js-tests/project/proj.win32/js-tests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ xcopy "$(ProjectDir)..\..\src" "$(OutDir)\src\" /e /Y
xcopy "$(ProjectDir)..\..\..\cpp-tests\Resources" "$(OutDir)\res\" /e /Y
copy "$(ProjectDir)..\..\main.js" "$(OutDir)"
copy "$(ProjectDir)..\..\project.json" "$(OutDir)"
xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\res\" /e /Y</Command>
xcopy "$(ProjectDir)..\..\resjs" "$(OutDir)\res\resjs\" /e /Y</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Copy js and resource files.</Message>
Expand Down
8 changes: 7 additions & 1 deletion tests/js-tests/project/proj.win8.1-universal/resources.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@
<DeploymentContent>true</DeploymentContent>
</_CustomResource>
</ItemGroup>

<ItemGroup>
<_CustomResource Include="..\..\..\resjs\**\*">
<Link>Assets\Resources\res\resjs\%(RecursiveDir)%(FileName)%(Extension)</Link>
<DeploymentContent>true</DeploymentContent>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</_CustomResource>
</ItemGroup>
<Target Name="_CollectCustomResources" BeforeTargets="AssignTargetPaths">
<Message Text="Adding resource: %(_CustomResource.Identity) -&gt; %(_CustomResource.Link)" />
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var CocosBuilderTestScene = TestScene.extend({
runThisTest:function(){
if (cc.sys.isNative)
{
cc.BuilderReader.setResourcePath("res/");
cc.BuilderReader.setResourcePath("res/resjs/");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cc.BuilderReader.registerController("HelloCocosBuilderLayer", {
_openTest : function(ccbFileName) {
if (cc.sys.isNative)
{
cc.BuilderReader.setResourcePath("res/");
cc.BuilderReader.setResourcePath("res/resjs/");
}
else
{
Expand Down

0 comments on commit 0c1347a

Please sign in to comment.