我使用eclipse Plug-in项目向导(使用eclipse Helios)创建了两个OSGI包A和B.
在bundle BI的清单文件中添加了bundle A作为依赖项.此外,我已经在A中导出了包,因此它们对于B是可见的.我还在捆绑包A中有一个.properties文件,我希望它对bundle B可见.在bundle AI的build.properties窗格中指定了:
source.. = src/
bin.includes = META-INF/,\
.,\
bundle_A.properties
Run Code Online (Sandbox Code Playgroud)
现在在BI中尝试使用以下命令加载.properties文件:
private Properties loadProperties() {
Properties properties = new Properties();
InputStream istream = this.getClass().getClassLoader().getResourceAsStream(
"bundle_A.properties");
try {
properties.load(istream);
} catch (IOException e) {
logger.error("Properties file not found!", e);
}
return properties;
}
Run Code Online (Sandbox Code Playgroud)
但是这会产生一个nullpointer异常(在类路径中找不到该文件).
是否可以从bundle A导出资源(就像导出包时一样)或者以某种方式从B以另一种方式访问A中的文件(从bundle B访问bundle A的类加载器)?
我尝试与同一捆绑的两个实体经理一起工作.我的配置是这样的:
orm:
default_entity_manager: default
entity_managers:
electra:
connection: electra
mappings:
XXDemoBundle: ~
default:
connection: default
mappings:
XXDemoBundle: ~
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉哪个entites属于哪个实体经理?如果我想使用不属于默认实体管理器的表,它现在崩溃了.
谢谢
这是我的连接配置:
doctrine:
dbal:
default_connection: default
connections:
default:
dbname: old_project
user: root
password: 123123
host: 1.1.1.1
port: 1
electra:
dbname: electra
user: root
password: 123123
host: 2.2.2.2
port: 2
orm:
default_entity_manager: electra
entity_managers:
electra:
connection: electra
mappings:
XXDemoBundle: ~
default:
connection: default
mappings:
XXDemoBundle: ~
Run Code Online (Sandbox Code Playgroud) 在发布之前,候选角度提供了捆绑文件.由于发布候选版本没有更多的捆绑文件.包括angular2和rxjs我的应用程序现在可以加载超过7秒的671个请求.这削弱了发展.
有谁知道如何捆绑angular和rxjs并将它们包含在system.config中?
我需要将一个String/integer值数组从一个Activity传递给另一个Activity.我该如何实现这一目标?
谢谢布鲁克斯.你的问题让我不断深入研究文件是否存在于我的包中 - 而事实并非如此!
所以通过使用这个代码(也在下面):iPhone/iPad:无法将文件夹从NSBundle复制到NSDocumentDirectory以及向Xcode正确添加目录的说明(从这里和下面)我能够使它工作.
将文件夹复制到Xcode:
目录应显示为蓝色而不是黄色.
-(void) copyDirectory:(NSString *)directory {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:directory];
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:directory];
if (![fileManager fileExistsAtPath:documentDBFolderPath]) {
//Create Directory!
[fileManager createDirectoryAtPath:documentDBFolderPath withIntermediateDirectories:NO attributes:nil error:&error];
} else {
NSLog(@"Directory exists! %@", documentDBFolderPath);
}
NSArray *fileList = [fileManager contentsOfDirectoryAtPath:resourceDBFolderPath error:&error];
for (NSString *s in fileList) {
NSString …Run Code Online (Sandbox Code Playgroud)当我尝试在Eclipse中安装新功能(使用ADT作为基础包)时,我得到了
‘Installing Software’ has encountered a problem.
An error occurred while collecting items to be installed
An error occurred while collecting items to be installed
session context was:(profile=profile, hase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,com.android.ide.eclipse.base,21.1.0.v201302060044-569685
No repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,21.1.0.v201302060044-569685
No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ddms,21.1.0.v201302060044-569685
Run Code Online (Sandbox Code Playgroud)
我已经安装了许多插件,我不确定哪一个可能会出错.如果其他人遇到这个错误并找到了解决方案,那就太好了.谢谢.
在Gemfile我做了以下改变:
-bash> git diff Gemfile
...
-gem 'rails', '4.0.4'
+gem 'rails', '4.0.5'
Run Code Online (Sandbox Code Playgroud)
然后我跑了bundle,得到一个停止显示的消息:
-bash> bundle
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
You have requested:
rails = 4.0.5
The bundle currently has rails locked at 4.0.4.
Try running `bundle update rails`
Run Code Online (Sandbox Code Playgroud)
然后我bundle update rails根据上面的消息跑了,得到了以下内容(注意我正在跳线而没有变化).
-bash> bundle update rails
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 10.3.2 (was 10.3.0)
Installing multi_json …Run Code Online (Sandbox Code Playgroud) 我在我的Gmail中收到了.bundle文件.我被告知这是一个git捆绑文件.我试图在崇高中打开它,我得到了一堆似乎看起来像十六进制值的东西.它被认为是代码挑战的指令.我有一个mac.任何帮助将非常感谢!
由于事实,ES6 模块(JavaScript 模块)可用于测试:
我想知道,我应该如何缩小和准备项目发布文件?早些时候,我已经将所有 JavaScript 文件捆绑到单个和缩小的文件中,除了我必须通过 XHR 或 Fetch API 动态加载 JS 文件的情况。
据我所知,现在准备一个带有 ES6 模块的单个缩小文件是不可能的,或者可能是,我只是误解了一些工作方式。
那么,有什么方法可以将我的 ES6 模块准备到单个文件中,以及我应该如何在 2017 年准备现代 JavaScript 项目,其中 JavaScript 模块将可用?
我正在尝试在您的具有故事板的项目之一中添加对 SPM 的支持。
目前我们抓住了它,UIStoryboard(name: String, bundle: String?)但这似乎不适用于 SPM,因为实际上没有捆绑。即使打印所有捆绑包也不会显示我们包裹的捆绑包。
我们可以通过任何方式支持故事板还是 SPM 只是文件?
尝试:
UIStoryboard(name: "GiftCards", bundle: Bundle(for: self))
UIStoryboard(name: "GiftCards", bundle: Bundle(for: type(of: self)))
UIStoryboard(name: "GiftCards", bundle: Bundle(identifier: "com.x.x"))
Run Code Online (Sandbox Code Playgroud)