Author: antelder
Date: Sat Jun 18 07:46:51 2011
New Revision: 1137135

URL: http://svn.apache.org/viewvc?rev=1137135&view=rev
Log:
Change setting a contributions dependencies explicitly from using the 
domain.properties file to use a <contributionName>.dependencies file to be more 
consistent with how the other files are used

Added:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import1.dependencies
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import2.dependencies
Removed:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/domain.properties
Modified:
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/readme.txt

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java?rev=1137135&r1=1137134&r2=1137135&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/TuscanyRuntime.java
 Sat Jun 18 07:46:51 2011
@@ -19,6 +19,7 @@
 
 package org.apache.tuscany.sca;
 
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileReader;
@@ -212,9 +213,16 @@ public class TuscanyRuntime {
                 }
                 
                 List<String> dependencyURIs = new ArrayList<String>();
-                String dependencyURIprop = 
domainProps.getProperty("dependencies." + fn);
-                if (dependencyURIprop != null && dependencyURIprop.length() > 
0) {
-                    dependencyURIs = 
Arrays.asList(dependencyURIprop.split(","));
+                File dependencyFile = new File(directory, fn + 
".dependencies");
+                if (dependencyFile.exists()) {
+                    BufferedReader br = new BufferedReader(new 
FileReader(dependencyFile));
+                    String s;
+                    while ((s = br.readLine()) != null)   {
+                        if (!s.startsWith("#") && s.trim().length() > 0) {
+                            
dependencyURIs.addAll(Arrays.asList(s.trim().split("[ ,]+")));
+                        }
+                    }
+                    br.close();
                 }
 
                 String curi = node.installContribution(null, f.getPath(), 
metaData, dependencyURIs);

Added: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import1.dependencies
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import1.dependencies?rev=1137135&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import1.dependencies
 (added)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import1.dependencies
 Sat Jun 18 07:46:51 2011
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License. 
+
+ export1
+

Added: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import2.dependencies
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import2.dependencies?rev=1137135&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import2.dependencies
 (added)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/import2.dependencies
 Sat Jun 18 07:46:51 2011
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License. 
+
+export2
+

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/readme.txt
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/readme.txt?rev=1137135&r1=1137134&r2=1137135&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/readme.txt
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/resources/test-domains/dependencies/readme.txt
 Sat Jun 18 07:46:51 2011
@@ -7,7 +7,7 @@ and "Hello 2" in export2.jar.
 Contributions import1.jar and import2.jar both import the package sample and 
use the 
 sample.HelloworldImpl class in the component implementation.
 
-The domain.propertes includes properties to explicitly set the dependency URIs 
used by 
+The *.dependencies files explicitly set the dependency URIs used by 
 Contributions import1.jar and import2.jar, without the explicit property the 
imports would just t
 use the first contribution found that exports the sample package.
 


Reply via email to