You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2011/12/22 06:54:53 UTC
svn commit: r1222072 [3/13] - in /incubator/npanday/trunk: ./
components/dotnet-executable/src/main/java/npanday/executable/
components/dotnet-executable/src/main/java/npanday/executable/compiler/
components/dotnet-executable/src/main/java/npanday/exec...
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/SettingsRepository.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/SettingsRepository.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/SettingsRepository.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/SettingsRepository.java Thu Dec 22 06:54:49 2011
@@ -1,20 +1,20 @@
-package npanday.vendor;
-
-import npanday.model.settings.DefaultSetup;
-import npanday.model.settings.Vendor;
-import npanday.registry.Repository;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public interface SettingsRepository
- extends Repository
-{
- List<Vendor> getVendors();
- DefaultSetup getDefaultSetup();
- boolean isEmpty();
-
- int getContentVersion();
-}
+package npanday.vendor;
+
+import npanday.model.settings.DefaultSetup;
+import npanday.model.settings.Vendor;
+import npanday.registry.Repository;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public interface SettingsRepository
+ extends Repository
+{
+ List<Vendor> getVendors();
+ DefaultSetup getDefaultSetup();
+ boolean isEmpty();
+
+ int getContentVersion();
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/SettingsRepository.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java Thu Dec 22 06:54:49 2011
@@ -1,125 +1,125 @@
-package npanday.vendor;
-
-import java.io.Serializable;
-
-import static com.google.common.base.Strings.isNullOrEmpty;
-
-/**
- * Specifies the requirements for a vendor to be used.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public class VendorRequirement
-{
- Vendor vendor;
-
- String vendorVersion;
-
- String frameworkVersion;
-
- public VendorRequirement( String vendorName, String vendorVersion, String frameworkVersion )
- {
- setVendor( vendorName );
- setVendorVersion( vendorVersion );
- setFrameworkVersion( frameworkVersion );
- }
-
- public VendorRequirement( Vendor vendor, String vendorVersion, String frameworkVersion )
- {
- setVendor( vendor );
- setVendorVersion( vendorVersion );
- setFrameworkVersion( frameworkVersion );
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getVendor()
- */
- public Vendor getVendor()
- {
- return vendor;
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getVendor()
- */
- public void setVendor( Vendor vendor )
- {
- this.vendor = vendor;
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getVendor()
- */
- public void setVendor( String vendorName )
- {
- if (!isNullOrEmpty(vendorName))
- {
- setVendor( VendorFactory.createVendorFromName( vendorName ) );
- }
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getVendorVersion()
- */
- public String getVendorVersion()
- {
- return vendorVersion;
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getVendorVersion()
- */
- public void setVendorVersion( String vendorVersion )
- {
- if ( "".equals( vendorVersion ) )
- {
- throw new IllegalArgumentException(
- "Given frameworkVersion must be a value or null; empty is not allowed." );
- }
-
- this.vendorVersion = vendorVersion;
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getFrameworkVersion()
- */
- public String getFrameworkVersion()
- {
- return frameworkVersion;
- }
-
- /**
- * @see npanday.vendor.VendorInfo#getFrameworkVersion()
- */
- public void setFrameworkVersion( String frameworkVersion )
- {
- if ( "".equals( frameworkVersion ) )
- {
- throw new IllegalArgumentException(
- "Given frameworkVersion must be a value or null; empty is not allowed." );
- }
-
- this.frameworkVersion = frameworkVersion;
- }
-
- /**
- * Determines, if the requirement is completed, hence, if vendor,
- * vendorVersion and frameworkVersion is filled in.
- */
- public boolean isComplete()
- {
- return vendor != null && vendorVersion != null && frameworkVersion != null;
- }
-
- public String toString()
- {
- return "[" + getClass().getSimpleName() + " for vendor " + visibleNullString( vendor ) + " version "
- + visibleNullString(getVendorVersion()) + ", Framework Version = "
- + visibleNullString(getFrameworkVersion()) + "]";
- }
-
- private Serializable visibleNullString( Object obj )
- {
- return ( obj == null ? "NULL" : obj.toString() );
- }
-}
+package npanday.vendor;
+
+import java.io.Serializable;
+
+import static com.google.common.base.Strings.isNullOrEmpty;
+
+/**
+ * Specifies the requirements for a vendor to be used.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class VendorRequirement
+{
+ Vendor vendor;
+
+ String vendorVersion;
+
+ String frameworkVersion;
+
+ public VendorRequirement( String vendorName, String vendorVersion, String frameworkVersion )
+ {
+ setVendor( vendorName );
+ setVendorVersion( vendorVersion );
+ setFrameworkVersion( frameworkVersion );
+ }
+
+ public VendorRequirement( Vendor vendor, String vendorVersion, String frameworkVersion )
+ {
+ setVendor( vendor );
+ setVendorVersion( vendorVersion );
+ setFrameworkVersion( frameworkVersion );
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getVendor()
+ */
+ public Vendor getVendor()
+ {
+ return vendor;
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getVendor()
+ */
+ public void setVendor( Vendor vendor )
+ {
+ this.vendor = vendor;
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getVendor()
+ */
+ public void setVendor( String vendorName )
+ {
+ if (!isNullOrEmpty(vendorName))
+ {
+ setVendor( VendorFactory.createVendorFromName( vendorName ) );
+ }
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getVendorVersion()
+ */
+ public String getVendorVersion()
+ {
+ return vendorVersion;
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getVendorVersion()
+ */
+ public void setVendorVersion( String vendorVersion )
+ {
+ if ( "".equals( vendorVersion ) )
+ {
+ throw new IllegalArgumentException(
+ "Given frameworkVersion must be a value or null; empty is not allowed." );
+ }
+
+ this.vendorVersion = vendorVersion;
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getFrameworkVersion()
+ */
+ public String getFrameworkVersion()
+ {
+ return frameworkVersion;
+ }
+
+ /**
+ * @see npanday.vendor.VendorInfo#getFrameworkVersion()
+ */
+ public void setFrameworkVersion( String frameworkVersion )
+ {
+ if ( "".equals( frameworkVersion ) )
+ {
+ throw new IllegalArgumentException(
+ "Given frameworkVersion must be a value or null; empty is not allowed." );
+ }
+
+ this.frameworkVersion = frameworkVersion;
+ }
+
+ /**
+ * Determines, if the requirement is completed, hence, if vendor,
+ * vendorVersion and frameworkVersion is filled in.
+ */
+ public boolean isComplete()
+ {
+ return vendor != null && vendorVersion != null && frameworkVersion != null;
+ }
+
+ public String toString()
+ {
+ return "[" + getClass().getSimpleName() + " for vendor " + visibleNullString( vendor ) + " version "
+ + visibleNullString(getVendorVersion()) + ", Framework Version = "
+ + visibleNullString(getFrameworkVersion()) + "]";
+ }
+
+ private Serializable visibleNullString( Object obj )
+ {
+ return ( obj == null ? "NULL" : obj.toString() );
+ }
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirement.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirementState.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirementState.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirementState.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirementState.java Thu Dec 22 06:54:49 2011
@@ -1,241 +1,241 @@
-/*
- * 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.
- */
-package npanday.vendor;
-
-/**
- * Provides a way to know how complete a vendor info object is or more concisely its state of completion.
- *
- * @author Shane Isbell
- */
-public enum VendorRequirementState
-{
- /**
- * State of VendorInfo object: Vendor is Microsoft, vendor version exists, framework version exists
- */
- MTT,
-
- /**
- * State of VendorInfo object: Vendor is Microsoft, vendor version exists, framework version does not exist
- */
- MTF,
-
- /**
- * State of VendorInfo object: Vendor is Microsoft, vendor version does not exist, framework version exists
- */
- MFT,
-
- /**
- * State of VendorInfo object: Vendor is Microsoft, vendor version does not exist, framework version does not exist
- */
- MFF,
-
- /**
- * State of VendorInfo object: Vendor is Novell, vendor version exists, framework version exists
- */
- NTT,
-
- /**
- * State of VendorInfo object: Vendor is Novell, vendor version exists, framework version does not exist
- */
- NTF,
-
- /**
- * State of VendorInfo object: Vendor is Novell, vendor version does not exist, framework version exists
- */
- NFT,
-
- /**
- * State of VendorInfo object: Vendor is Novell, vendor version does not exist, framework version does not exist
- */
- NFF,
-
- /**
- * State of VendorInfo object: Vendor is GNU, vendor version exists, framework version exists
- */
- GTT,
-
- /**
- * State of VendorInfo object: Vendor is GNU, vendor version exists, framework version does not exist
- */
- GTF,
-
- /**
- * State of VendorInfo object: Vendor is GNU, vendor version does not exist, framework version exists
- */
- GFT,
-
- /**
- * State of VendorInfo object: Vendor is GNU vendor version does not exist, framework version does not exist
- */
- GFF,
-
- /**
- * State of VendorInfo object: Vendor is unknown, vendor version exists, framework version exists
- */
- FTT,
-
- /**
- * State of VendorInfo object: Vendor is unknown, vendor version exists, framework version does not exist
- */
- FTF,
-
- /**
- * State of VendorInfo object: Vendor is unknown, vendor version does not exist, framework version exists
- */
- FFT,
-
- /**
- * State of VendorInfo object: Vendor is unknown, vendor version does not exist, framework version does not exist
- */
- FFF,
-
- /**
- * Exit state of VendorInfo object
- */
- EXIT,
-
- /**
- * Start state of VendorInfo object
- */
- START,
-
- /**
- * Null state of VendorInfo object
- */
- NULL;
-
- /**
- * Returns the completion state of the specified vendor info
- *
- * @param vendorRequirement the vendor info to determine the state of completion
- * @return the state of the specified vendor info
- */
- public VendorRequirementState getState( VendorRequirement vendorRequirement )
- {
- if ( vendorRequirement == null )
- {
- return NULL;
- }
-
- if ( vendorRequirement.getVendor() == null )
- {
- if ( vendorRequirement.getVendorVersion() == null )
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return FFF;
- }
- else
- {
- return FFT;
- }
- }
- else
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return FTF;
- }
- else
- {
- return FTT;
- }
- }
- }
- else if ( vendorRequirement.getVendor().equals( Vendor.MICROSOFT ) )
- {
- if ( vendorRequirement.getVendorVersion() == null )
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return MFF;
- }
- else
- {
- return MFT;
- }
- }
- else
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return MTF;
- }
- else
- {
- return MTT;
- }
- }
- }
- else if ( vendorRequirement.getVendor().equals( Vendor.MONO ) )
- {
- if ( vendorRequirement.getVendorVersion() == null )
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return NFF;
- }
- else
- {
- return NFT;
- }
- }
- else
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return NTF;
- }
- else
- {
- return NTT;
- }
- }
- }
- else if ( vendorRequirement.getVendor().equals( Vendor.DOTGNU ) )
- {
- if ( vendorRequirement.getVendorVersion() == null )
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return GFF;
- }
- else
- {
- return GFT;
- }
- }
- else
- {
- if ( vendorRequirement.getFrameworkVersion() == null )
- {
- return GTF;
- }
- else
- {
- return GTT;
- }
- }
- }
- else
- {
- return EXIT;
- }
- }
-}
+/*
+ * 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.
+ */
+package npanday.vendor;
+
+/**
+ * Provides a way to know how complete a vendor info object is or more concisely its state of completion.
+ *
+ * @author Shane Isbell
+ */
+public enum VendorRequirementState
+{
+ /**
+ * State of VendorInfo object: Vendor is Microsoft, vendor version exists, framework version exists
+ */
+ MTT,
+
+ /**
+ * State of VendorInfo object: Vendor is Microsoft, vendor version exists, framework version does not exist
+ */
+ MTF,
+
+ /**
+ * State of VendorInfo object: Vendor is Microsoft, vendor version does not exist, framework version exists
+ */
+ MFT,
+
+ /**
+ * State of VendorInfo object: Vendor is Microsoft, vendor version does not exist, framework version does not exist
+ */
+ MFF,
+
+ /**
+ * State of VendorInfo object: Vendor is Novell, vendor version exists, framework version exists
+ */
+ NTT,
+
+ /**
+ * State of VendorInfo object: Vendor is Novell, vendor version exists, framework version does not exist
+ */
+ NTF,
+
+ /**
+ * State of VendorInfo object: Vendor is Novell, vendor version does not exist, framework version exists
+ */
+ NFT,
+
+ /**
+ * State of VendorInfo object: Vendor is Novell, vendor version does not exist, framework version does not exist
+ */
+ NFF,
+
+ /**
+ * State of VendorInfo object: Vendor is GNU, vendor version exists, framework version exists
+ */
+ GTT,
+
+ /**
+ * State of VendorInfo object: Vendor is GNU, vendor version exists, framework version does not exist
+ */
+ GTF,
+
+ /**
+ * State of VendorInfo object: Vendor is GNU, vendor version does not exist, framework version exists
+ */
+ GFT,
+
+ /**
+ * State of VendorInfo object: Vendor is GNU vendor version does not exist, framework version does not exist
+ */
+ GFF,
+
+ /**
+ * State of VendorInfo object: Vendor is unknown, vendor version exists, framework version exists
+ */
+ FTT,
+
+ /**
+ * State of VendorInfo object: Vendor is unknown, vendor version exists, framework version does not exist
+ */
+ FTF,
+
+ /**
+ * State of VendorInfo object: Vendor is unknown, vendor version does not exist, framework version exists
+ */
+ FFT,
+
+ /**
+ * State of VendorInfo object: Vendor is unknown, vendor version does not exist, framework version does not exist
+ */
+ FFF,
+
+ /**
+ * Exit state of VendorInfo object
+ */
+ EXIT,
+
+ /**
+ * Start state of VendorInfo object
+ */
+ START,
+
+ /**
+ * Null state of VendorInfo object
+ */
+ NULL;
+
+ /**
+ * Returns the completion state of the specified vendor info
+ *
+ * @param vendorRequirement the vendor info to determine the state of completion
+ * @return the state of the specified vendor info
+ */
+ public VendorRequirementState getState( VendorRequirement vendorRequirement )
+ {
+ if ( vendorRequirement == null )
+ {
+ return NULL;
+ }
+
+ if ( vendorRequirement.getVendor() == null )
+ {
+ if ( vendorRequirement.getVendorVersion() == null )
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return FFF;
+ }
+ else
+ {
+ return FFT;
+ }
+ }
+ else
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return FTF;
+ }
+ else
+ {
+ return FTT;
+ }
+ }
+ }
+ else if ( vendorRequirement.getVendor().equals( Vendor.MICROSOFT ) )
+ {
+ if ( vendorRequirement.getVendorVersion() == null )
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return MFF;
+ }
+ else
+ {
+ return MFT;
+ }
+ }
+ else
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return MTF;
+ }
+ else
+ {
+ return MTT;
+ }
+ }
+ }
+ else if ( vendorRequirement.getVendor().equals( Vendor.MONO ) )
+ {
+ if ( vendorRequirement.getVendorVersion() == null )
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return NFF;
+ }
+ else
+ {
+ return NFT;
+ }
+ }
+ else
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return NTF;
+ }
+ else
+ {
+ return NTT;
+ }
+ }
+ }
+ else if ( vendorRequirement.getVendor().equals( Vendor.DOTGNU ) )
+ {
+ if ( vendorRequirement.getVendorVersion() == null )
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return GFF;
+ }
+ else
+ {
+ return GFT;
+ }
+ }
+ else
+ {
+ if ( vendorRequirement.getFrameworkVersion() == null )
+ {
+ return GTF;
+ }
+ else
+ {
+ return GTT;
+ }
+ }
+ }
+ else
+ {
+ return EXIT;
+ }
+ }
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorRequirementState.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorUnknownException.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorUnknownException.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorUnknownException.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorUnknownException.java Thu Dec 22 06:54:49 2011
@@ -1,70 +1,70 @@
-/*
- * 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.
- */
-package npanday.vendor;
-
-/**
- * Exception thrown when the vendor is not recognized.
- *
- * @author Shane Isbell
- */
-public class VendorUnknownException
- extends RuntimeException
-{
-
- static final long serialVersionUID = -72946723034227L;
-
- /**
- * Constructs an <code>VendorUnknownException</code> with no exception message.
- */
- public VendorUnknownException()
- {
- super();
- }
-
- /**
- * Constructs an <code>VendorUnknownException</code> with the specified exception message.
- *
- * @param message the exception message
- */
- public VendorUnknownException( String message )
- {
- super( message );
- }
-
- /**
- * Constructs an <code>VendorUnknownException</code> with the specified exception message and cause of the exception.
- *
- * @param message the exception message
- * @param cause the cause of the exception
- */
- public VendorUnknownException( String message, Throwable cause )
- {
- super( message, cause );
- }
-
- /**
- * Constructs an <code>VendorUnknownException</code> with the cause of the exception.
- *
- * @param cause the cause of the exception
- */
- public VendorUnknownException( Throwable cause )
- {
- super( cause );
- }
-}
+/*
+ * 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.
+ */
+package npanday.vendor;
+
+/**
+ * Exception thrown when the vendor is not recognized.
+ *
+ * @author Shane Isbell
+ */
+public class VendorUnknownException
+ extends RuntimeException
+{
+
+ static final long serialVersionUID = -72946723034227L;
+
+ /**
+ * Constructs an <code>VendorUnknownException</code> with no exception message.
+ */
+ public VendorUnknownException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs an <code>VendorUnknownException</code> with the specified exception message.
+ *
+ * @param message the exception message
+ */
+ public VendorUnknownException( String message )
+ {
+ super( message );
+ }
+
+ /**
+ * Constructs an <code>VendorUnknownException</code> with the specified exception message and cause of the exception.
+ *
+ * @param message the exception message
+ * @param cause the cause of the exception
+ */
+ public VendorUnknownException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ /**
+ * Constructs an <code>VendorUnknownException</code> with the cause of the exception.
+ *
+ * @param cause the cause of the exception
+ */
+ public VendorUnknownException( Throwable cause )
+ {
+ super( cause );
+ }
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/VendorUnknownException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/FileBasedSettingsRepository.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/FileBasedSettingsRepository.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/FileBasedSettingsRepository.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/FileBasedSettingsRepository.java Thu Dec 22 06:54:49 2011
@@ -1,224 +1,224 @@
-/*
- * 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.
- */
-package npanday.vendor.impl;
-
-import npanday.PlatformUnsupportedException;
-import npanday.model.settings.DefaultSetup;
-import npanday.model.settings.Framework;
-import npanday.model.settings.NPandaySettings;
-import npanday.model.settings.Vendor;
-import npanday.model.settings.io.xpp3.NPandaySettingsXpp3Reader;
-import npanday.registry.ModelInterpolator;
-import npanday.registry.NPandayRepositoryException;
-import npanday.registry.impl.AbstractMultisourceRepository;
-import npanday.vendor.SettingsRepository;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Provides methods for loading and reading the npanday-settings config file.
- *
- * @author Shane Isbell
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- *
- * @plexus.component
- * role="npanday.vendor.SettingsRepository"
- */
-public final class FileBasedSettingsRepository
- extends AbstractMultisourceRepository<NPandaySettings>
- implements SettingsRepository
-{
- /**
- * List of all vendors from the various sources. The <code>Vendor</code> is the raw model type.
- */
- private List<Vendor> vendors = new ArrayList<Vendor>();
-
- /**
- * The default setup: framework version, vendor, vendor version. If no information is provided by the user, then
- * this information will be used to choose the environment. It may also be used for partial matches, if appropriate.
- */
- private DefaultSetup defaultSetup;
-
- /**
- * Constructor. This method is intended to be invoked by the <code>RepositoryRegistry<code>, not by the
- * application developer.
- */
- public FileBasedSettingsRepository()
- {
- }
-
- @Override
- protected NPandaySettings loadFromReader( Reader reader, Hashtable properties )
- throws IOException, XmlPullParserException
- {
- NPandaySettingsXpp3Reader xpp3Reader = new NPandaySettingsXpp3Reader();
- return xpp3Reader.read( reader );
- }
-
- @Override
- protected void mergeLoadedModel( NPandaySettings settings )
- throws NPandayRepositoryException
- {
- vendors.addAll( settings.getVendors() );
-
- final DefaultSetup currentDefaultSetup = settings.getDefaultSetup();
-
- if ( currentDefaultSetup != null && defaultSetup != null )
- {
- getLogger().warn(
- "NPANDAY-104-006: The default setup was already defined, got overridden by a subsequent source, was: "
- + defaultSetup + ", is now " + currentDefaultSetup );
- }
-
- defaultSetup = currentDefaultSetup;
- }
-
- @Override
- protected void clear()
- {
- vendors.clear();
- defaultSetup = null;
- }
-
- /**
- * Gets the raw configured model.
- *
- * @return Unmodifiable list.
- */
- public List<Vendor> getVendors()
- {
- return Collections.unmodifiableList( vendors );
- }
-
- /**
- * Returns the install root for the .NET framework for the specified parameters. None of the parameter values
- * should be null.
- *
- * @param vendor the vendor name
- * @param vendorVersion the vendor version
- * @param frameworkVersion the .NET framework version
- * @return the install root for the .NET framework
- * @throws npanday.PlatformUnsupportedException
- * if there is no install root found for the specified parameters
- */
- public File getInstallRootFor( String vendor, String vendorVersion, String frameworkVersion )
- throws PlatformUnsupportedException
- {
- if ( vendor == null || vendorVersion == null || frameworkVersion == null )
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-104-001: One of more of the parameters is null: Vendor = " + vendor + ", Vendor Version = "
- + vendorVersion + ", Framework Version = " + frameworkVersion );
- }
- for ( Vendor v : vendors )
- {
- if ( vendor.equals( v.getVendorName().trim() ) && vendorVersion.equals( v.getVendorVersion().trim() ) )
- {
- List<Framework> frameworks = v.getFrameworks();
-
- for ( Framework framework : frameworks )
- {
- if ( frameworkVersion.equals( framework.getFrameworkVersion().trim() ) )
- {
- return new File( framework.getInstallRoot() );
- }
- }
- }
- }
- throw new PlatformUnsupportedException(
- "NPANDAY-104-002: Unable to find install root: Vendor = " + vendor + ", Vendor Version = " + vendorVersion
- + ", Framework Version = " + frameworkVersion );
- }
-
- List<File> getExecutablePathsFor( String vendor, String vendorVersion, String frameworkVersion )
- throws PlatformUnsupportedException
- {
- List<File> executablePaths = new ArrayList<File>();
- if ( vendor == null || vendorVersion == null || frameworkVersion == null )
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-104-006: One of more of the parameters is null: Vendor = " + vendor + ", Vendor Version = "
- + vendorVersion + ", Framework Version = " + frameworkVersion );
- }
- for ( Vendor v : vendors )
- {
- if ( vendor.equals( v.getVendorName().trim() ) && vendorVersion.equals( v.getVendorVersion().trim() ) )
- {
- List<Framework> frameworks = v.getFrameworks();
- for ( Framework framework : frameworks )
- {
- if ( frameworkVersion.equals( framework.getFrameworkVersion().trim() ) )
- {
- List paths = framework.getExecutablePaths();
- for ( Object path : paths )
- {
- executablePaths.add( new File( (String) path ) );
- }
- }
- }
- }
- }
- return executablePaths;
- }
-
- /**
- * Returns the default setup: framework version, vendor, vendor version. If no information is provided by the user, then
- * this information will be used to choose the environment. It may also be used for partial matches, if appropriate.
- *
- * @return the default setup: framework version, vendor, vendor version
- */
- public DefaultSetup getDefaultSetup()
- {
- return defaultSetup;
- }
-
- public boolean isEmpty()
- {
- return getVendors().size() == 0 && defaultSetup == null;
- }
-
- public void initialize()
- throws InitializationException
- {
-
- }
-
- // ### COMPONENTS REQUIRED BY THE BASE CLASS
-
- /**
- * @plexus.requirement
- */
- private ModelInterpolator interpolator;
-
- @Override
- protected ModelInterpolator getInterpolator()
- {
- return interpolator;
- }
-}
-
+/*
+ * 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.
+ */
+package npanday.vendor.impl;
+
+import npanday.PlatformUnsupportedException;
+import npanday.model.settings.DefaultSetup;
+import npanday.model.settings.Framework;
+import npanday.model.settings.NPandaySettings;
+import npanday.model.settings.Vendor;
+import npanday.model.settings.io.xpp3.NPandaySettingsXpp3Reader;
+import npanday.registry.ModelInterpolator;
+import npanday.registry.NPandayRepositoryException;
+import npanday.registry.impl.AbstractMultisourceRepository;
+import npanday.vendor.SettingsRepository;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Provides methods for loading and reading the npanday-settings config file.
+ *
+ * @author Shane Isbell
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ *
+ * @plexus.component
+ * role="npanday.vendor.SettingsRepository"
+ */
+public final class FileBasedSettingsRepository
+ extends AbstractMultisourceRepository<NPandaySettings>
+ implements SettingsRepository
+{
+ /**
+ * List of all vendors from the various sources. The <code>Vendor</code> is the raw model type.
+ */
+ private List<Vendor> vendors = new ArrayList<Vendor>();
+
+ /**
+ * The default setup: framework version, vendor, vendor version. If no information is provided by the user, then
+ * this information will be used to choose the environment. It may also be used for partial matches, if appropriate.
+ */
+ private DefaultSetup defaultSetup;
+
+ /**
+ * Constructor. This method is intended to be invoked by the <code>RepositoryRegistry<code>, not by the
+ * application developer.
+ */
+ public FileBasedSettingsRepository()
+ {
+ }
+
+ @Override
+ protected NPandaySettings loadFromReader( Reader reader, Hashtable properties )
+ throws IOException, XmlPullParserException
+ {
+ NPandaySettingsXpp3Reader xpp3Reader = new NPandaySettingsXpp3Reader();
+ return xpp3Reader.read( reader );
+ }
+
+ @Override
+ protected void mergeLoadedModel( NPandaySettings settings )
+ throws NPandayRepositoryException
+ {
+ vendors.addAll( settings.getVendors() );
+
+ final DefaultSetup currentDefaultSetup = settings.getDefaultSetup();
+
+ if ( currentDefaultSetup != null && defaultSetup != null )
+ {
+ getLogger().warn(
+ "NPANDAY-104-006: The default setup was already defined, got overridden by a subsequent source, was: "
+ + defaultSetup + ", is now " + currentDefaultSetup );
+ }
+
+ defaultSetup = currentDefaultSetup;
+ }
+
+ @Override
+ protected void clear()
+ {
+ vendors.clear();
+ defaultSetup = null;
+ }
+
+ /**
+ * Gets the raw configured model.
+ *
+ * @return Unmodifiable list.
+ */
+ public List<Vendor> getVendors()
+ {
+ return Collections.unmodifiableList( vendors );
+ }
+
+ /**
+ * Returns the install root for the .NET framework for the specified parameters. None of the parameter values
+ * should be null.
+ *
+ * @param vendor the vendor name
+ * @param vendorVersion the vendor version
+ * @param frameworkVersion the .NET framework version
+ * @return the install root for the .NET framework
+ * @throws npanday.PlatformUnsupportedException
+ * if there is no install root found for the specified parameters
+ */
+ public File getInstallRootFor( String vendor, String vendorVersion, String frameworkVersion )
+ throws PlatformUnsupportedException
+ {
+ if ( vendor == null || vendorVersion == null || frameworkVersion == null )
+ {
+ throw new PlatformUnsupportedException(
+ "NPANDAY-104-001: One of more of the parameters is null: Vendor = " + vendor + ", Vendor Version = "
+ + vendorVersion + ", Framework Version = " + frameworkVersion );
+ }
+ for ( Vendor v : vendors )
+ {
+ if ( vendor.equals( v.getVendorName().trim() ) && vendorVersion.equals( v.getVendorVersion().trim() ) )
+ {
+ List<Framework> frameworks = v.getFrameworks();
+
+ for ( Framework framework : frameworks )
+ {
+ if ( frameworkVersion.equals( framework.getFrameworkVersion().trim() ) )
+ {
+ return new File( framework.getInstallRoot() );
+ }
+ }
+ }
+ }
+ throw new PlatformUnsupportedException(
+ "NPANDAY-104-002: Unable to find install root: Vendor = " + vendor + ", Vendor Version = " + vendorVersion
+ + ", Framework Version = " + frameworkVersion );
+ }
+
+ List<File> getExecutablePathsFor( String vendor, String vendorVersion, String frameworkVersion )
+ throws PlatformUnsupportedException
+ {
+ List<File> executablePaths = new ArrayList<File>();
+ if ( vendor == null || vendorVersion == null || frameworkVersion == null )
+ {
+ throw new PlatformUnsupportedException(
+ "NPANDAY-104-006: One of more of the parameters is null: Vendor = " + vendor + ", Vendor Version = "
+ + vendorVersion + ", Framework Version = " + frameworkVersion );
+ }
+ for ( Vendor v : vendors )
+ {
+ if ( vendor.equals( v.getVendorName().trim() ) && vendorVersion.equals( v.getVendorVersion().trim() ) )
+ {
+ List<Framework> frameworks = v.getFrameworks();
+ for ( Framework framework : frameworks )
+ {
+ if ( frameworkVersion.equals( framework.getFrameworkVersion().trim() ) )
+ {
+ List paths = framework.getExecutablePaths();
+ for ( Object path : paths )
+ {
+ executablePaths.add( new File( (String) path ) );
+ }
+ }
+ }
+ }
+ }
+ return executablePaths;
+ }
+
+ /**
+ * Returns the default setup: framework version, vendor, vendor version. If no information is provided by the user, then
+ * this information will be used to choose the environment. It may also be used for partial matches, if appropriate.
+ *
+ * @return the default setup: framework version, vendor, vendor version
+ */
+ public DefaultSetup getDefaultSetup()
+ {
+ return defaultSetup;
+ }
+
+ public boolean isEmpty()
+ {
+ return getVendors().size() == 0 && defaultSetup == null;
+ }
+
+ public void initialize()
+ throws InitializationException
+ {
+
+ }
+
+ // ### COMPONENTS REQUIRED BY THE BASE CLASS
+
+ /**
+ * @plexus.requirement
+ */
+ private ModelInterpolator interpolator;
+
+ @Override
+ protected ModelInterpolator getInterpolator()
+ {
+ return interpolator;
+ }
+}
+
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/FileBasedSettingsRepository.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/SettingsBasedVendorInfo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/SettingsBasedVendorInfo.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/SettingsBasedVendorInfo.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/SettingsBasedVendorInfo.java Thu Dec 22 06:54:49 2011
@@ -1,253 +1,253 @@
-package npanday.vendor.impl;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import npanday.ArtifactType;
-import npanday.ArtifactTypeHelper;
-import npanday.PlatformUnsupportedException;
-import npanday.model.settings.Framework;
-import npanday.vendor.Vendor;
-import npanday.vendor.VendorFactory;
-import npanday.vendor.VendorInfo;
-
-import javax.annotation.Nullable;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A {@link VendorInfo} backed by configurations from {@link npanday.model.settings.Vendor}
- * and {@link npanday.model.settings.Framework}
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public class SettingsBasedVendorInfo
- implements VendorInfo
-{
- private npanday.model.settings.Vendor configuredVendor;
-
- private Framework configuredFramework;
-
- private boolean isDefault;
-
- private Vendor vendor;
-
- private List<File> executablePaths;
-
- public SettingsBasedVendorInfo( npanday.model.settings.Vendor configuredVendor, Framework configuredFramework )
- {
-
- this.configuredVendor = configuredVendor;
- this.configuredFramework = configuredFramework;
-
- this.isDefault =
- configuredVendor.getIsDefault() != null && configuredVendor.getIsDefault().toLowerCase().trim().equals(
- "true" );
- this.vendor = VendorFactory.createVendorFromName( configuredVendor.getVendorName() );
-
- collectExistingPaths();
- }
-
- private void collectExistingPaths()
- {
- List<File> configuredPaths = new ArrayList<File>();
-
- // add .NET install root as path
- if (getInstallRoot() != null)
- {
- configuredPaths.add( getInstallRoot() );
- }
-
- // add .NET-SDK install root as path
- if ( getSdkInstallRoot() != null )
- {
- configuredPaths.add( getSdkInstallRoot() );
- }
-
- // copy configured additional execution paths
- if ( configuredFramework.getExecutablePaths() != null )
- {
- for ( Object path : configuredFramework.getExecutablePaths() )
- {
- configuredPaths.add( new File( (String) path ) );
- }
- }
-
- executablePaths = ImmutableList.copyOf( Iterables.filter( configuredPaths, new Predicate<File>() {
- public boolean apply( @Nullable File file )
- {
- return file.exists();
- }
- }));
- }
-
- public File getSdkInstallRoot()
- {
- final String sdkInstallRoot = configuredFramework.getSdkInstallRoot();
- if ( Strings.isNullOrEmpty( sdkInstallRoot ))
- return null;
- return new File( sdkInstallRoot );
- }
-
- public File getInstallRoot()
- {
- final String installRoot = configuredFramework.getInstallRoot();
- if ( Strings.isNullOrEmpty( installRoot ))
- return null;
- return new File( installRoot );
- }
-
- // TODO: Move this to a composed type: GacFinderStrategy
- public File getGlobalAssemblyCacheDirectoryFor( String artifactType )
- throws PlatformUnsupportedException
- {
- if (!ArtifactTypeHelper.isDotnetAnyGac( artifactType ))
- return null;
-
- if ( ArtifactTypeHelper.isDotnetGenericGac( artifactType ))
- {
- if ( vendor.equals( Vendor.MICROSOFT ) && getFrameworkVersion().equals( "1.1.4322" ) )
- {
- return new File( System.getenv("SystemRoot"), "\\assembly\\GAC\\" );
- }
- else if ( vendor.equals( Vendor.MICROSOFT ) )
- {
- // Layout changed since 2.0
- // http://discuss.joelonsoftware.com/default.asp?dotnet.12.383883.5
- return new File( System.getenv("SystemRoot"), "\\assembly\\GAC_MSIL\\" );
- }
- // TODO: fully implement finder for generic gac-type - better configure it somehow!
- else if ( vendor.equals( Vendor.MONO ) )
- {
- return getGacRootForMono();
- }
- }
- else if ( artifactType.equals( ArtifactType.GAC.getPackagingType() ) )
- {
- return new File( System.getenv("SystemRoot"), "\\assembly\\GAC\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_32.getPackagingType() ) )
- {
- return new File(System.getenv("SystemRoot"), "\\assembly\\GAC_32\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_32_4.getPackagingType() ) )
- {
- return new File(System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_32\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_64.getPackagingType() ) )
- {
- return new File(System.getenv("SystemRoot"), "\\assembly\\GAC_64\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_64_4.getPackagingType() ) )
- {
- return new File(System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_64\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_MSIL.getPackagingType() ) )
- {
- return new File( System.getenv("SystemRoot"), "\\assembly\\GAC_MSIL\\" );
- }
- else if ( artifactType.equals( ArtifactType.GAC_MSIL4.getPackagingType() ) )
- {
- return new File( System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_MSIL\\" );
- }
- throw new PlatformUnsupportedException("NPANDAY-113-006: Could not locate a valid GAC");
- }
-
- private File getGacRootForMono()
- throws PlatformUnsupportedException
- {
- // TODO: Multiple implemenations for finding mono gac...
- /*
- Found this somewhere...
-
- File sdkInstallRoot = getSdkInstallRoot();
- File gacRoot = new File( getSdkInstallRoot().getParentFile().getAbsolutePath() + "/lib/mono/gac" );
- if ( !gacRoot.exists() )
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-113-005: The Mono GAC path does not exist: Path = " +
- gacRoot.getAbsolutePath() );
-
- }
- return gacRoot;
-
- */
-
- String path = System.getenv( "PATH" );
- if ( path != null )
- {
- String[] tokens = path.split( System.getProperty( "path.separator" ) );
- for ( String token : tokens )
- {
- File gacRoot = new File( new File( token ).getParentFile(), "lib/mono/gac/" );
- if ( gacRoot.exists() )
- {
- return gacRoot;
- }
- }
- }
- //check settings file
-
- String monoRoot = System.getenv( "MONO_ROOT" );
- if ( monoRoot != null && !new File( monoRoot ).exists() )
- {
- // getLogger().warn( "MONO_ROOT has been incorrectly set. Trying /usr : MONO_ROOT = " + monoRoot );
- }
- else if ( monoRoot != null )
- {
- return new File(( !monoRoot.endsWith( File.separator ) ) ? monoRoot + File.separator : monoRoot);
- }
-
- if ( new File( "/usr/lib/mono/gac/" ).exists() )
- {
- // Linux default location
- return new File( "/usr/lib/mono/gac/" );
- }
- else if ( new File( "/Library/Frameworks/Mono.framework/Home/lib/mono/gac/" ).exists() )
- {
- // Mac OS X default location
- return new File( "/Library/Frameworks/Mono.framework/Home/lib/mono/gac/" );
- }
- else
- {
- throw new PlatformUnsupportedException(
- "NPANDAY-061-008: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable." );
- }
- }
-
-
- public Vendor getVendor()
- {
- return vendor;
- }
-
- public String getVendorVersion()
- {
- return configuredVendor.getVendorVersion();
- }
-
- public String getFrameworkVersion()
- {
- return configuredFramework.getFrameworkVersion();
- }
-
- // TODO: Iterable should be enough here!
- public List<File> getExecutablePaths()
- {
- return executablePaths;
- }
-
- public boolean isDefault()
- {
- return isDefault;
- }
-
- public String toString()
- {
- return "[Configured Vendor Info for " + vendor + " " + getVendorVersion() + ", Framework Version = "
- + getFrameworkVersion() + "]";
- }
-}
-
+package npanday.vendor.impl;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import npanday.ArtifactType;
+import npanday.ArtifactTypeHelper;
+import npanday.PlatformUnsupportedException;
+import npanday.model.settings.Framework;
+import npanday.vendor.Vendor;
+import npanday.vendor.VendorFactory;
+import npanday.vendor.VendorInfo;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A {@link VendorInfo} backed by configurations from {@link npanday.model.settings.Vendor}
+ * and {@link npanday.model.settings.Framework}
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class SettingsBasedVendorInfo
+ implements VendorInfo
+{
+ private npanday.model.settings.Vendor configuredVendor;
+
+ private Framework configuredFramework;
+
+ private boolean isDefault;
+
+ private Vendor vendor;
+
+ private List<File> executablePaths;
+
+ public SettingsBasedVendorInfo( npanday.model.settings.Vendor configuredVendor, Framework configuredFramework )
+ {
+
+ this.configuredVendor = configuredVendor;
+ this.configuredFramework = configuredFramework;
+
+ this.isDefault =
+ configuredVendor.getIsDefault() != null && configuredVendor.getIsDefault().toLowerCase().trim().equals(
+ "true" );
+ this.vendor = VendorFactory.createVendorFromName( configuredVendor.getVendorName() );
+
+ collectExistingPaths();
+ }
+
+ private void collectExistingPaths()
+ {
+ List<File> configuredPaths = new ArrayList<File>();
+
+ // add .NET install root as path
+ if (getInstallRoot() != null)
+ {
+ configuredPaths.add( getInstallRoot() );
+ }
+
+ // add .NET-SDK install root as path
+ if ( getSdkInstallRoot() != null )
+ {
+ configuredPaths.add( getSdkInstallRoot() );
+ }
+
+ // copy configured additional execution paths
+ if ( configuredFramework.getExecutablePaths() != null )
+ {
+ for ( Object path : configuredFramework.getExecutablePaths() )
+ {
+ configuredPaths.add( new File( (String) path ) );
+ }
+ }
+
+ executablePaths = ImmutableList.copyOf( Iterables.filter( configuredPaths, new Predicate<File>() {
+ public boolean apply( @Nullable File file )
+ {
+ return file.exists();
+ }
+ }));
+ }
+
+ public File getSdkInstallRoot()
+ {
+ final String sdkInstallRoot = configuredFramework.getSdkInstallRoot();
+ if ( Strings.isNullOrEmpty( sdkInstallRoot ))
+ return null;
+ return new File( sdkInstallRoot );
+ }
+
+ public File getInstallRoot()
+ {
+ final String installRoot = configuredFramework.getInstallRoot();
+ if ( Strings.isNullOrEmpty( installRoot ))
+ return null;
+ return new File( installRoot );
+ }
+
+ // TODO: Move this to a composed type: GacFinderStrategy
+ public File getGlobalAssemblyCacheDirectoryFor( String artifactType )
+ throws PlatformUnsupportedException
+ {
+ if (!ArtifactTypeHelper.isDotnetAnyGac( artifactType ))
+ return null;
+
+ if ( ArtifactTypeHelper.isDotnetGenericGac( artifactType ))
+ {
+ if ( vendor.equals( Vendor.MICROSOFT ) && getFrameworkVersion().equals( "1.1.4322" ) )
+ {
+ return new File( System.getenv("SystemRoot"), "\\assembly\\GAC\\" );
+ }
+ else if ( vendor.equals( Vendor.MICROSOFT ) )
+ {
+ // Layout changed since 2.0
+ // http://discuss.joelonsoftware.com/default.asp?dotnet.12.383883.5
+ return new File( System.getenv("SystemRoot"), "\\assembly\\GAC_MSIL\\" );
+ }
+ // TODO: fully implement finder for generic gac-type - better configure it somehow!
+ else if ( vendor.equals( Vendor.MONO ) )
+ {
+ return getGacRootForMono();
+ }
+ }
+ else if ( artifactType.equals( ArtifactType.GAC.getPackagingType() ) )
+ {
+ return new File( System.getenv("SystemRoot"), "\\assembly\\GAC\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_32.getPackagingType() ) )
+ {
+ return new File(System.getenv("SystemRoot"), "\\assembly\\GAC_32\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_32_4.getPackagingType() ) )
+ {
+ return new File(System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_32\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_64.getPackagingType() ) )
+ {
+ return new File(System.getenv("SystemRoot"), "\\assembly\\GAC_64\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_64_4.getPackagingType() ) )
+ {
+ return new File(System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_64\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_MSIL.getPackagingType() ) )
+ {
+ return new File( System.getenv("SystemRoot"), "\\assembly\\GAC_MSIL\\" );
+ }
+ else if ( artifactType.equals( ArtifactType.GAC_MSIL4.getPackagingType() ) )
+ {
+ return new File( System.getenv("SystemRoot"), "\\Microsoft.NET\\assembly\\GAC_MSIL\\" );
+ }
+ throw new PlatformUnsupportedException("NPANDAY-113-006: Could not locate a valid GAC");
+ }
+
+ private File getGacRootForMono()
+ throws PlatformUnsupportedException
+ {
+ // TODO: Multiple implemenations for finding mono gac...
+ /*
+ Found this somewhere...
+
+ File sdkInstallRoot = getSdkInstallRoot();
+ File gacRoot = new File( getSdkInstallRoot().getParentFile().getAbsolutePath() + "/lib/mono/gac" );
+ if ( !gacRoot.exists() )
+ {
+ throw new PlatformUnsupportedException(
+ "NPANDAY-113-005: The Mono GAC path does not exist: Path = " +
+ gacRoot.getAbsolutePath() );
+
+ }
+ return gacRoot;
+
+ */
+
+ String path = System.getenv( "PATH" );
+ if ( path != null )
+ {
+ String[] tokens = path.split( System.getProperty( "path.separator" ) );
+ for ( String token : tokens )
+ {
+ File gacRoot = new File( new File( token ).getParentFile(), "lib/mono/gac/" );
+ if ( gacRoot.exists() )
+ {
+ return gacRoot;
+ }
+ }
+ }
+ //check settings file
+
+ String monoRoot = System.getenv( "MONO_ROOT" );
+ if ( monoRoot != null && !new File( monoRoot ).exists() )
+ {
+ // getLogger().warn( "MONO_ROOT has been incorrectly set. Trying /usr : MONO_ROOT = " + monoRoot );
+ }
+ else if ( monoRoot != null )
+ {
+ return new File(( !monoRoot.endsWith( File.separator ) ) ? monoRoot + File.separator : monoRoot);
+ }
+
+ if ( new File( "/usr/lib/mono/gac/" ).exists() )
+ {
+ // Linux default location
+ return new File( "/usr/lib/mono/gac/" );
+ }
+ else if ( new File( "/Library/Frameworks/Mono.framework/Home/lib/mono/gac/" ).exists() )
+ {
+ // Mac OS X default location
+ return new File( "/Library/Frameworks/Mono.framework/Home/lib/mono/gac/" );
+ }
+ else
+ {
+ throw new PlatformUnsupportedException(
+ "NPANDAY-061-008: Could not locate Global Assembly Cache for Mono. Try setting the MONO_ROOT environmental variable." );
+ }
+ }
+
+
+ public Vendor getVendor()
+ {
+ return vendor;
+ }
+
+ public String getVendorVersion()
+ {
+ return configuredVendor.getVendorVersion();
+ }
+
+ public String getFrameworkVersion()
+ {
+ return configuredFramework.getFrameworkVersion();
+ }
+
+ // TODO: Iterable should be enough here!
+ public List<File> getExecutablePaths()
+ {
+ return executablePaths;
+ }
+
+ public boolean isDefault()
+ {
+ return isDefault;
+ }
+
+ public String toString()
+ {
+ return "[Configured Vendor Info for " + vendor + " " + getVendorVersion() + ", Framework Version = "
+ + getFrameworkVersion() + "]";
+ }
+}
+
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/main/java/npanday/vendor/impl/SettingsBasedVendorInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/VendorRequirementStateTest.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/VendorRequirementStateTest.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/VendorRequirementStateTest.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/VendorRequirementStateTest.java Thu Dec 22 06:54:49 2011
@@ -1,127 +1,127 @@
-/*
- * 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.
- */
-package npanday.vendor;
-
-import junit.framework.TestCase;
-
-public class VendorRequirementStateTest
- extends TestCase
-{
-
- public void testMTT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, "2.0.50727", "2.0.50727" ) );
- assert ( VendorRequirementState.MTT.equals( vendorRequirementState ) );
- }
-
- public void testMFT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, null, "2.0.50727" ) );
- assert ( VendorRequirementState.MFT.equals( vendorRequirementState ) );
- }
-
- public void testMFF()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, null, null ) );
- assert ( VendorRequirementState.MFF.equals( vendorRequirementState ) );
- }
-
- public void testMTF()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, "2.0.50727", null ) );
- assert ( VendorRequirementState.MTF.equals( vendorRequirementState ) );
- }
-
- public void testNTT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, "1.1.18", "2.0.50727" ) );
- assert ( VendorRequirementState.NTT.equals( vendorRequirementState ) );
- }
-
- public void testNFT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, null, "2.0.50727" ) );
- assert ( VendorRequirementState.NFT.equals( vendorRequirementState ) );
- }
-
- public void testNFF()
- {
- VendorRequirementState vendorRequirementState =
- VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, null, null ) );
- assert ( VendorRequirementState.NFF.equals( vendorRequirementState ) );
- }
-
- public void testNTF()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, "1.1.18", null ) );
- assert ( VendorRequirementState.NTF.equals( vendorRequirementState ) );
- }
-
- public void testGTT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, "0.7.2", "2.0.50727" ) );
- assert ( VendorRequirementState.GTT.equals( vendorRequirementState ) );
- }
-
- public void testGFT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, null, "2.0.50727" ) );
- assert ( VendorRequirementState.GFT.equals( vendorRequirementState ) );
- }
-
- public void testGFF()
- {
- VendorRequirementState vendorRequirementState =
- VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, null, null ) );
- assert ( VendorRequirementState.GFF.equals( vendorRequirementState ) );
- }
-
- public void testGTF()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, "0.7.2", null ) );
- assert ( VendorRequirementState.GTF.equals( vendorRequirementState ) );
- }
-
- public void testFTT()
- {
- VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, "0.7.2", "2.0.50727" ) );
- assert ( VendorRequirementState.FTT.equals( vendorRequirementState ) );
- }
-
- public void testFFT()
- {
- VendorRequirementState vendorRequirementState =
- VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, null, "2.0.50727" ) );
- assert ( VendorRequirementState.FFT.equals( vendorRequirementState ) );
- }
-
- public void testFFF()
- {
- VendorRequirementState vendorRequirementState =
- VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, null, null ) );
- assert ( VendorRequirementState.FFF.equals( vendorRequirementState ) );
- }
-
- public void testFTF()
- {
- VendorRequirementState vendorRequirementState =
- VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, "0.7.2", null ) );
- assert ( VendorRequirementState.FTF.equals( vendorRequirementState ) );
- }
-}
+/*
+ * 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.
+ */
+package npanday.vendor;
+
+import junit.framework.TestCase;
+
+public class VendorRequirementStateTest
+ extends TestCase
+{
+
+ public void testMTT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, "2.0.50727", "2.0.50727" ) );
+ assert ( VendorRequirementState.MTT.equals( vendorRequirementState ) );
+ }
+
+ public void testMFT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, null, "2.0.50727" ) );
+ assert ( VendorRequirementState.MFT.equals( vendorRequirementState ) );
+ }
+
+ public void testMFF()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, null, null ) );
+ assert ( VendorRequirementState.MFF.equals( vendorRequirementState ) );
+ }
+
+ public void testMTF()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MICROSOFT, "2.0.50727", null ) );
+ assert ( VendorRequirementState.MTF.equals( vendorRequirementState ) );
+ }
+
+ public void testNTT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, "1.1.18", "2.0.50727" ) );
+ assert ( VendorRequirementState.NTT.equals( vendorRequirementState ) );
+ }
+
+ public void testNFT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, null, "2.0.50727" ) );
+ assert ( VendorRequirementState.NFT.equals( vendorRequirementState ) );
+ }
+
+ public void testNFF()
+ {
+ VendorRequirementState vendorRequirementState =
+ VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, null, null ) );
+ assert ( VendorRequirementState.NFF.equals( vendorRequirementState ) );
+ }
+
+ public void testNTF()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.MONO, "1.1.18", null ) );
+ assert ( VendorRequirementState.NTF.equals( vendorRequirementState ) );
+ }
+
+ public void testGTT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, "0.7.2", "2.0.50727" ) );
+ assert ( VendorRequirementState.GTT.equals( vendorRequirementState ) );
+ }
+
+ public void testGFT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, null, "2.0.50727" ) );
+ assert ( VendorRequirementState.GFT.equals( vendorRequirementState ) );
+ }
+
+ public void testGFF()
+ {
+ VendorRequirementState vendorRequirementState =
+ VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, null, null ) );
+ assert ( VendorRequirementState.GFF.equals( vendorRequirementState ) );
+ }
+
+ public void testGTF()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( Vendor.DOTGNU, "0.7.2", null ) );
+ assert ( VendorRequirementState.GTF.equals( vendorRequirementState ) );
+ }
+
+ public void testFTT()
+ {
+ VendorRequirementState vendorRequirementState = VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, "0.7.2", "2.0.50727" ) );
+ assert ( VendorRequirementState.FTT.equals( vendorRequirementState ) );
+ }
+
+ public void testFFT()
+ {
+ VendorRequirementState vendorRequirementState =
+ VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, null, "2.0.50727" ) );
+ assert ( VendorRequirementState.FFT.equals( vendorRequirementState ) );
+ }
+
+ public void testFFF()
+ {
+ VendorRequirementState vendorRequirementState =
+ VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, null, null ) );
+ assert ( VendorRequirementState.FFF.equals( vendorRequirementState ) );
+ }
+
+ public void testFTF()
+ {
+ VendorRequirementState vendorRequirementState =
+ VendorRequirementState.NULL.getState( VendorTestFactory.getVendorRequirement( null, "0.7.2", null ) );
+ assert ( VendorRequirementState.FTF.equals( vendorRequirementState ) );
+ }
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/VendorRequirementStateTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/impl/MutableVendorInfo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/impl/MutableVendorInfo.java?rev=1222072&r1=1222071&r2=1222072&view=diff
==============================================================================
--- incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/impl/MutableVendorInfo.java (original)
+++ incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/impl/MutableVendorInfo.java Thu Dec 22 06:54:49 2011
@@ -1,121 +1,121 @@
-package npanday.vendor.impl;
-
-import npanday.PlatformUnsupportedException;
-import npanday.vendor.Vendor;
-import npanday.vendor.VendorInfo;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * A pojo implementing {@link VendorInfo}. Use this, if you need a prototype
- * for searching or you want to build up a copy yourself.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public class MutableVendorInfo
- implements VendorInfo
-{
- private Vendor vendor;
- private String vendorVersion;
- private String frameworkVersion;
-
- private File sdkInstallRoot;
- private File installRoot;
- private List<File> executablePaths;
-
- private boolean isDefault;
-
- public MutableVendorInfo(){
-
- }
-
- public MutableVendorInfo( Vendor vendor, String vendorVersion, String frameworkVersion )
- {
- this.vendor = vendor;
- this.vendorVersion = vendorVersion;
- this.frameworkVersion = frameworkVersion;
- }
-
- public boolean isDefault()
- {
- return isDefault;
- }
-
- public void setDefault( boolean aDefault )
- {
- isDefault = aDefault;
- }
-
- public List<File> getExecutablePaths()
- {
- return executablePaths;
- }
-
- public void setExecutablePaths( List<File> executablePaths )
- {
- this.executablePaths = executablePaths;
- }
-
- public Vendor getVendor()
- {
- return vendor;
- }
-
- public void setVendor( Vendor vendor )
- {
- this.vendor = vendor;
- }
-
- public String getVendorVersion()
- {
- return vendorVersion;
- }
-
- public void setVendorVersion( String vendorVersion )
- {
- this.vendorVersion = vendorVersion;
- }
-
- public String getFrameworkVersion()
- {
- return frameworkVersion;
- }
-
- public void setFrameworkVersion( String frameworkVersion )
- {
- this.frameworkVersion = frameworkVersion;
- }
-
- public File getSdkInstallRoot()
- {
- return sdkInstallRoot;
- }
-
- public void setSdkInstallRoot( File sdkInstallRoot )
- {
- this.sdkInstallRoot = sdkInstallRoot;
- }
-
- public File getInstallRoot()
- {
- return installRoot;
- }
-
- public File getGlobalAssemblyCacheDirectoryFor( String artifactType )
- throws PlatformUnsupportedException
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setInstallRoot( File installRoot )
- {
- this.installRoot = installRoot;
- }
-
- public String toString()
- {
- return "[Manual Vendor Info for " + vendor + " " + vendorVersion + ", Framework Version = "
- + frameworkVersion + ", Executable Paths = " + ( ( executablePaths != null ) ? executablePaths : "" + "]" );
- }
-}
+package npanday.vendor.impl;
+
+import npanday.PlatformUnsupportedException;
+import npanday.vendor.Vendor;
+import npanday.vendor.VendorInfo;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * A pojo implementing {@link VendorInfo}. Use this, if you need a prototype
+ * for searching or you want to build up a copy yourself.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class MutableVendorInfo
+ implements VendorInfo
+{
+ private Vendor vendor;
+ private String vendorVersion;
+ private String frameworkVersion;
+
+ private File sdkInstallRoot;
+ private File installRoot;
+ private List<File> executablePaths;
+
+ private boolean isDefault;
+
+ public MutableVendorInfo(){
+
+ }
+
+ public MutableVendorInfo( Vendor vendor, String vendorVersion, String frameworkVersion )
+ {
+ this.vendor = vendor;
+ this.vendorVersion = vendorVersion;
+ this.frameworkVersion = frameworkVersion;
+ }
+
+ public boolean isDefault()
+ {
+ return isDefault;
+ }
+
+ public void setDefault( boolean aDefault )
+ {
+ isDefault = aDefault;
+ }
+
+ public List<File> getExecutablePaths()
+ {
+ return executablePaths;
+ }
+
+ public void setExecutablePaths( List<File> executablePaths )
+ {
+ this.executablePaths = executablePaths;
+ }
+
+ public Vendor getVendor()
+ {
+ return vendor;
+ }
+
+ public void setVendor( Vendor vendor )
+ {
+ this.vendor = vendor;
+ }
+
+ public String getVendorVersion()
+ {
+ return vendorVersion;
+ }
+
+ public void setVendorVersion( String vendorVersion )
+ {
+ this.vendorVersion = vendorVersion;
+ }
+
+ public String getFrameworkVersion()
+ {
+ return frameworkVersion;
+ }
+
+ public void setFrameworkVersion( String frameworkVersion )
+ {
+ this.frameworkVersion = frameworkVersion;
+ }
+
+ public File getSdkInstallRoot()
+ {
+ return sdkInstallRoot;
+ }
+
+ public void setSdkInstallRoot( File sdkInstallRoot )
+ {
+ this.sdkInstallRoot = sdkInstallRoot;
+ }
+
+ public File getInstallRoot()
+ {
+ return installRoot;
+ }
+
+ public File getGlobalAssemblyCacheDirectoryFor( String artifactType )
+ throws PlatformUnsupportedException
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setInstallRoot( File installRoot )
+ {
+ this.installRoot = installRoot;
+ }
+
+ public String toString()
+ {
+ return "[Manual Vendor Info for " + vendor + " " + vendorVersion + ", Framework Version = "
+ + frameworkVersion + ", Executable Paths = " + ( ( executablePaths != null ) ? executablePaths : "" + "]" );
+ }
+}
Propchange: incubator/npanday/trunk/components/dotnet-vendor/src/test/java/npanday/vendor/impl/MutableVendorInfo.java
------------------------------------------------------------------------------
svn:eol-style = native