目前,Apportable无法使用具有相同名称的目标构建项目。这是因为子项目。我有几个子项目,都包含名为iOS Static Library
和OS X Static Library
的目标。并重写了他们的PRODUCT_NAME
以防止.a
文件名重复。
无论如何,当我看到构建日志时,Apportable似乎使用目标名称作为一种全局标识符。在建造时崩溃。
如何在多个子项目中使用具有相同名称的目标?
这是完整的构建日志。
Erionirr:Test9 Eonil$ apportable uninstall; rm -rf ~/.apportable/SDK/Build/android-armeabi-debug; rm -rf *.approj; apportable debug
Building to /Users/Eonil/.apportable/SDK/Build/android-armeabi-debug
Loading configuration.
Finished parsing configuration.
Loading configuration.
Finished parsing configuration.
Loading configuration.
Finished parsing configuration.
scons: Building targets ...
scons: *** [Build/android-armeabi-debug/Test9/Test9-debug.apk_debug] Source `Build/android-armeabi-debug/Test9/Test9-debug.apk' not found, needed by target `Build/android-armeabi-debug/Test9/Test9-debug.apk_debug'.
scons: building terminated because of errors.
Building to /Users/Eonil/.apportable/SDK/Build/android-armeabi-debug
Updating configuration parameters... Building Xcode project /Users/Eonil/Desktop/Apportable Knowledge Base and Bug Reporting/Running Test/Test9/Test9
Scanning build configuration for target Test9
Merging configuration parameters.
It looks like you're compiling this app for the first time.
Test9.approj/configuration.json will be created for you.
A few quick questions and you'll be on your way:
If the app is using OpenGL ES, does it use ES1 or ES2? (Cocos2D 1.X uses ES1, 2.X uses ES2)
[1/2] 2
Should the app initially launch in landscape or portrait orientation? (default: landscape)
[L/p] p
Loading configuration.
Finished parsing configuration.
Merging configuration parameters.
Loading configuration.
Finished parsing configuration.
Merging configuration parameters.
Loading configuration.
Finished parsing configuration.
Traceback (most recent call last):
File "/Users/Eonil/.apportable/SDK/bin/apportable", line 701, in <module>
run(env)
File "/Users/Eonil/.apportable/SDK/bin/apportable", line 677, in run
results = actions[args.action](env)
File "/Users/Eonil/.apportable/SDK/bin/apportable", line 95, in DebugAction
return env.DebugApp(site_init.BuildApplication(env, env['BUILD_TARGET']))
File "/Users/Eonil/.apportable/SDK/site_scons/site_init.py", line 351, in BuildApplication
return build.App(env, app_sconscript)
File "/Users/Eonil/.apportable/SDK/site_scons/build/__init__.py", line 619, in App
results = env.BuildApp(sources=sources, header_paths=headers, defines=defines, flags=flags, config=configs, deps=deps, libs=libs, java_libs=java_libs, assets=assets, pch=pchs, modules=modules, java_sources=java_sources, java_sourcepaths=java_sourcepaths, java_res_dirs=java_res_dirs)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
return self.method(*nargs, **kwargs)
File "/Users/Eonil/.apportable/SDK/site_scons/site_init.py", line 915, in BuildApp
build.Module(env, module["build_cwd"], module)
File "/Users/Eonil/.apportable/SDK/site_scons/build/__init__.py", line 681, in Module
env.BuildModule(target["target"], sources=sources, header_paths=headers, defines=defines, flags=flags, deps=deps, libs=libs, java_libs=java_libs, assets=assets, pch=pchs, modules=modules, java_sources=java_sources, java_sourcepaths=java_sourcepaths, java_res_dirs=java_res_dirs)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
return self.method(*nargs, **kwargs)
File "/Users/Eonil/.apportable/SDK/site_scons/site_init.py", line 1014, in BuildModule
BuildLibrary(env, name, sources=sources, header_paths=header_paths, static=True, defines=defines, flags=flags, deps=deps, libs=libs, pch=pch, app=True)
File "/Users/Eonil/.apportable/SDK/site_scons/site_init.py", line 755, in BuildLibrary
lib = building_env.StaticLibrary(name, objects)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 259, in __call__
return MethodWrapper.__call__(self, target, source, *args, **kw)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Environment.py", line 223, in __call__
return self.method(*nargs, **kwargs)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Builder.py", line 632, in __call__
return self._execute(env, target, source, OverrideWarner(kw), ekw)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Builder.py", line 556, in _execute
_node_errors(self, env, tlist, slist)
File "/Users/Eonil/.apportable/SDK/lib/scons/engine/SCons/Builder.py", line 315, in _node_errors
raise UserError(msg)
SCons.Errors.UserError: Multiple ways to build the same target were specified for: Build/android-armeabi-debug/Eonil.Test9/iOS Static Library/libiOS Static Library.a (from ['Build/android-armeabi-debug/Eonil.Test9/Users/Eonil/Desktop/Apportable Knowledge Base and Bug Reporting/Running Test/Test9/Subproject1/Subproject1/Subproject1.m.o'] and from ['Build/android-armeabi-debug/Eonil.Test9/Users/Eonil/Desktop/Apportable Knowledge Base and Bug Reporting/Running Test/Test9/Subproject2/Subproject2/Subproject2.m.o'])
Erionirr:Test9 Eonil$
答案 0 :(得分:2)
目前这不受支持,我们一直在内部讨论接近命名库的不同方法,这将避免这个问题,但仍然保持链接有些简化。请继续关注我们的发布说明页面,当我们为此获得解决方案时,我们肯定会在用户有效更改时注意到它。
答案 1 :(得分:2)
如果它不太不方便,给你的目标唯一的名称,如“iOS静态库Cocos2D”应解决问题,直到我们可以在构建系统级别解决此问题。