Skip to Content.
Sympa Menu

notify-dpml - r1700 - in trunk: . central/site/src/docs/about/download central/site/src/docs/util/cli main main/depot/library/src/main/net/dpml/library main/depot/library/src/main/net/dpml/library/impl main/depot/tools/src/main/net/dpml/tools/tasks main/lang/module/etc

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell at BerliOS <mcconnell AT mail.berlios.de>
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: r1700 - in trunk: . central/site/src/docs/about/download central/site/src/docs/util/cli main main/depot/library/src/main/net/dpml/library main/depot/library/src/main/net/dpml/library/impl main/depot/tools/src/main/net/dpml/tools/tasks main/lang/module/etc
  • Date: Tue, 1 Aug 2006 09:48:54 +0200

Author: mcconnell
Date: 2006-08-01 09:48:52 +0200 (Tue, 01 Aug 2006)
New Revision: 1700

Modified:
trunk/central/site/src/docs/about/download/archive.xml
trunk/central/site/src/docs/util/cli/index.xml
trunk/index.xml
trunk/main/bootstrap.bat
trunk/main/depot/library/src/main/net/dpml/library/Feature.java
trunk/main/depot/library/src/main/net/dpml/library/Resource.java

trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JarTask.java
trunk/main/lang/module/etc/module.xsd
Log:
add support for a pure decimal version build

Modified: trunk/central/site/src/docs/about/download/archive.xml
===================================================================
--- trunk/central/site/src/docs/about/download/archive.xml 2006-07-31
03:31:13 UTC (rev 1699)
+++ trunk/central/site/src/docs/about/download/archive.xml 2006-08-01
07:48:52 UTC (rev 1700)
@@ -28,69 +28,6 @@
configuration resource assignment preventing the execution of
the metro tool with trace or debug options.</li>
<li>Corrections to component directive documentation.</li>
- </ul>
-
- <table>
- <tr>
- <td>Windows NSIS Installer</td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.exe";>
- dpml-sdk-win32-@VERSION@.exe</a>
- </td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.exe.md5";>
- MD5</a>
- </td>
- </tr>
- <tr>
- <td>Windows Zip Archive</td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.zip";>
- dpml-sdk-win32-@VERSION@.zip</a>
- </td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.zip.md5";>
- MD5</a>
- </td>
- </tr>
- <tr>
- <td>Linux Archive</td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz";>
- dpml-sdk-linux-@VERSION@.tar.gz</a>
- </td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz.md5";>
- MD5</a>
- </td>
- </tr>
- <tr>
- <td>Documentation Archive</td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-docs-@VERSION@.zip";>
- dpml-sdk-docs-@VERSION@.zip</a>
- </td>
- <td>
- <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-docs-@VERSION@.zip.md5";>
- MD5</a>
- </td>
- </tr>
- </table>
-
- <p>
- Online <a href="http://api.dpml.net/dpml/@VERSION@";>Javadoc</a> and
- <a href="http://www.dpml.net/reports/@VERSION@/junit";>JUnit</a>
reports are available.
- </p>
-
- </subsection>
-
- <subsection name="Build 1.0.0-1692">
-
- <p>
- Resolved issues and/or enhancements:
- </p>
-
- <ul>
<li>Depot and Metro tutorials.</li>
<li>Added decimal version prefix support.</li>
<li>Super-component support in component defintion.</li>
@@ -114,52 +51,52 @@
<tr>
<td>Windows NSIS Installer</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-win32-1.0.0-1692.exe";>
- dpml-sdk-win32-1.0.0-1692.exe</a>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.exe";>
+ dpml-sdk-win32-@VERSION@.exe</a>
</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-win32-1.0.0-1692.exe.md5";>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.exe.md5";>
MD5</a>
</td>
</tr>
<tr>
<td>Windows Zip Archive</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-win32-1.0.0-1692.zip";>
- dpml-sdk-win32-1.0.0-1692.zip</a>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.zip";>
+ dpml-sdk-win32-@VERSION@.zip</a>
</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-win32-1.0.0-1692.zip.md5";>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-win32-@VERSION@.zip.md5";>
MD5</a>
</td>
</tr>
<tr>
<td>Linux Archive</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-linux-1.0.0-1692.tar.gz";>
- dpml-sdk-linux-1.0.0-1692.tar.gz</a>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz";>
+ dpml-sdk-linux-@VERSION@.tar.gz</a>
</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-linux-1.0.0-1692.tar.gz.md5";>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-linux-@VERSION@.tar.gz.md5";>
MD5</a>
</td>
</tr>
<tr>
<td>Documentation Archive</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-docs-1.0.0-1692.zip";>
- dpml-sdk-docs-1.0.0-1692.zip</a>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-docs-@VERSION@.zip";>
+ dpml-sdk-docs-@VERSION@.zip</a>
</td>
<td>
- <a
href="http://download.dpml.net/milestones/1.0.0-1692/dpml-sdk-docs-1.0.0-1692.zip.md5";>
+ <a
href="http://download.dpml.net/milestones/@VERSION@/dpml-sdk-docs-@VERSION@.zip.md5";>
MD5</a>
</td>
</tr>
</table>

<p>
- Online <a href="http://api.dpml.net/dpml/1.0.0-1692";>Javadoc</a>,
- <a href="http://www.dpml.net/reports/1.0.0-1692/junit";>JUnit</a> and
<a href="http://www.dpml.net/reports/1.0.0-1692/catalog";>Catalog</a> reports
are available.
+ Online <a href="http://api.dpml.net/dpml/@VERSION@";>Javadoc</a> and
+ <a href="http://www.dpml.net/reports/@VERSION@/junit";>JUnit</a>
reports are available.
</p>

</subsection>

Modified: trunk/central/site/src/docs/util/cli/index.xml
===================================================================
--- trunk/central/site/src/docs/util/cli/index.xml 2006-07-31 03:31:13
UTC (rev 1699)
+++ trunk/central/site/src/docs/util/cli/index.xml 2006-08-01 07:48:52
UTC (rev 1700)
@@ -33,7 +33,7 @@
The CLI indexprovides an API for processing command line interfaces.
</p>
<p>
- The implementation is based on the Jakarta Commons CLI2 indexwritten
+ The implementation is based on the Jakarta Commons CLI2 library
written
by John Keyes and Rob Oxspring.
</p>
<p>

Modified: trunk/index.xml
===================================================================
--- trunk/index.xml 2006-07-31 03:31:13 UTC (rev 1699)
+++ trunk/index.xml 2006-08-01 07:48:52 UTC (rev 1700)
@@ -23,9 +23,10 @@
<properties>
<property name="java.util.logging.config.class" value="dpml"/>
<property name="project.version-prefix.enabled" value="true"/>
+ <property name="project.version-postfix.enabled" value="false"/>
<property name="project.major.version" value="1"/>
<property name="project.minor.version" value="0"/>
- <property name="project.micro.version" value="1"/>
+ <property name="project.micro.version" value="0"/>
</properties>

<types>
@@ -35,7 +36,7 @@
<filters>
<filter token="PUBLISHER-NAME" value="${project.publisher.name}"/>
<filter token="PUBLISHER-URL" value="${project.publisher.url}"/>
- <feature token="PROJECT-VERSION" id="version"/>
+ <feature token="PROJECT-VERSION" id="decimal"/>
</filters>

<module file="lang/module.xml"/>

Modified: trunk/main/bootstrap.bat
===================================================================
--- trunk/main/bootstrap.bat 2006-07-31 03:31:13 UTC (rev 1699)
+++ trunk/main/bootstrap.bat 2006-08-01 07:48:52 UTC (rev 1700)
@@ -17,8 +17,8 @@
REM


-set SPEC=%1
-set ID=%2
+set ARG_ONE=%1
+set ARG_TWO=%2
CALL :antlib-cleanup
IF ERRORLEVEL 1 GOTO :exit
CALL :xml-setup
@@ -144,10 +144,26 @@
GOTO :EOF

:build
+
+REM if %ARG_TWO% is undefined then %SPEC_ID% is undefined and %BUILD_ID% is
%ARG_ONE%
+
SET SPEC_ID=""
-IF "%ID%" == "" SET ID=SNAPSHOT
-SET BUILD_ID=-Dbuild.signature=%ID%
-IF NOT "%SPEC%" == "" SET SPEC_ID=-Dbuild.decimal=%SPEC%
+SET BUILD_ID=""
+
+IF NOT "%ARG_TWO%" == "" GOTO SETUP_WITH_TWO_ARGS
+IF "%ARG_TWO%" == "" GOTO SETUP_WITH_ONE_ARGS
+
+:SETUP_WITH_ONE_ARGS
+SET BUILD_ID=-Dbuild.signature=%ARG_ONE%
+GOTO EXECUTE
+
+:SETUP_WITH_TWO_ARGS
+SET SPEC_ID=-Dbuild.decimal=%ARG_ONE%
+SET BUILD_ID=-Dbuild.signature=%ARG_TWO%
+GOTO EXECUTE
+
+
+:EXECUTE
ECHO ### START BUILD ###
@echo on
CD

Modified: trunk/main/depot/library/src/main/net/dpml/library/Feature.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Feature.java
2006-07-31 03:31:13 UTC (rev 1699)
+++ trunk/main/depot/library/src/main/net/dpml/library/Feature.java
2006-08-01 07:48:52 UTC (rev 1700)
@@ -51,6 +51,11 @@
public static final Feature VERSION = new Feature( "version" );

/**
+ * Resource decimal version.
+ */
+ public static final Feature DECIMAL = new Feature( "decimal" );
+
+ /**
* Resource version.
*/
public static final Feature URI = new Feature( "uri" );
@@ -79,7 +84,7 @@
* Array of scope enumeration values.
*/
private static final Feature[] ENUM_VALUES =
- new Feature[]{NAME, GROUP, VERSION, URI, SPEC, PATH, FILENAME,
BASEDIR};
+ new Feature[]{NAME, GROUP, VERSION, DECIMAL, URI, SPEC, PATH,
FILENAME, BASEDIR};

/**
* Returns an array of activation enum values.
@@ -129,6 +134,10 @@
{
return VERSION;
}
+ else if( value.equalsIgnoreCase( "decimal" ) )
+ {
+ return DECIMAL;
+ }
else if( value.equalsIgnoreCase( "uri" ) )
{
return URI;
@@ -222,6 +231,18 @@
return version;
}
}
+ else if( feature.equals( Feature.DECIMAL ) )
+ {
+ Version version = resource.getDecimalVersion();
+ if( null == version )
+ {
+ return "";
+ }
+ else
+ {
+ return version.toString();
+ }
+ }
else if( feature.equals( Feature.URI ) )
{
return resolveURIFeature( resource, type, alias );

Modified: trunk/main/depot/library/src/main/net/dpml/library/Resource.java
===================================================================
--- trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-07-31 03:31:13 UTC (rev 1699)
+++ trunk/main/depot/library/src/main/net/dpml/library/Resource.java
2006-08-01 07:48:52 UTC (rev 1700)
@@ -26,6 +26,7 @@
import net.dpml.transit.Artifact;

import net.dpml.lang.Category;
+import net.dpml.lang.Version;

import net.dpml.util.Resolver;

@@ -62,6 +63,12 @@
String getStatutoryVersion();

/**
+ * Return the decimal version.
+ * @return the version
+ */
+ Version getDecimalVersion();
+
+ /**
* Return the fully qualified path to the resource.
* @return the path
*/

Modified:
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
===================================================================
---
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-07-31 03:31:13 UTC (rev 1699)
+++
trunk/main/depot/library/src/main/net/dpml/library/impl/DefaultResource.java
2006-08-01 07:48:52 UTC (rev 1700)
@@ -78,6 +78,11 @@
*/
public static final String SNAPSHOT = "SNAPSHOT";

+ /**
+ * Constant RELEASE symbol.
+ */
+ public static final String RELEASE = "RELEASE";
+
private final DefaultLibrary m_library;
private final ResourceDirective m_directive;
private final DefaultModule m_parent;
@@ -309,6 +314,30 @@
}
}
}
+
+ /**
+ * Return the decimal version. If version prefixing is enabled
+ * via the <tt>project.version-prefix.enabled</tt> property then the value
+ * returned will be derived from the project major, minor and micro
version
+ * properties, otherwise a null value will be returned.
+ *
+ * @return the version
+ */
+ public Version getDecimalVersion()
+ {
+ boolean flag = getBooleanProperty( "project.version-prefix.enabled",
false );
+ if( flag )
+ {
+ int major = getMajorVersion();
+ int minor = getMinorVersion();
+ int micro = getMicroVersion();
+ return new Version( major, minor, micro );
+ }
+ else
+ {
+ return null;
+ }
+ }

/**
* Return the fully qualified path to the resource.
@@ -1375,11 +1404,18 @@
}
else
{
- boolean flag = getBooleanProperty(
"project.version-prefix.enabled", false );
- if( flag )
+ Version decimal = getDecimalVersion();
+ if( null != decimal )
{
- Version decimal = getDecimalVersion();
- return decimal.toString() + "-" + value;
+ boolean flag = getBooleanProperty(
"project.version-postfix.enabled", true );
+ if( flag )
+ {
+ return decimal.toString() + "-" + value;
+ }
+ else
+ {
+ return decimal.toString();
+ }
}
else
{
@@ -1388,20 +1424,16 @@
}
}

- private Version getDecimalVersion()
- {
- int major = getMajorVersion();
- int minor = getMinorVersion();
- int micro = getMicroVersion();
- return new Version( major, minor, micro );
- }
-
private String getBuildSignature()
{
- String system = System.getProperty( "build.signature", SNAPSHOT );
+ String system = System.getProperty( "build.signature", null );
String value = getProperty( "build.signature", system );
- if( value.equals( "project.timestamp" ) )
+ if( null == value )
{
+ return SNAPSHOT;
+ }
+ else if( value.equals( "project.timestamp" ) )
+ {
return TIMESTAMP;
}
else

Modified: trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JarTask.java
===================================================================
--- trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JarTask.java
2006-07-31 03:31:13 UTC (rev 1699)
+++ trunk/main/depot/tools/src/main/net/dpml/tools/tasks/JarTask.java
2006-08-01 07:48:52 UTC (rev 1700)
@@ -20,6 +20,8 @@

import java.io.File;

+import net.dpml.lang.Version;
+
import net.dpml.library.Resource;
import net.dpml.library.Type;

@@ -27,6 +29,7 @@
import org.apache.tools.ant.taskdefs.Jar;
import org.apache.tools.ant.taskdefs.Manifest;
import org.apache.tools.ant.taskdefs.ManifestException;
+import org.apache.tools.ant.taskdefs.Copy;

/**
* Execute all plugins relative to the current build phase.
@@ -125,38 +128,61 @@
{
return;
}
- File jar = getDestination();
- boolean modified = createJarFile( source, jar );
- if( modified )
- {
- checksum( jar );
- asc( jar );
- }
+ File jar = createJarFile( source );
+ checksum( jar );
+ asc( jar );
}

- private boolean createJarFile( final File classes, final File jarFile )
- {
- final File dir = jarFile.getParentFile();
- mkDir( dir );
-
- long modified = -1;
- if( jarFile.exists() )
- {
- modified = jarFile.lastModified();
- }
-
+ private File createJarFile( final File classes )
+ {
+ final File temp = getTempFile();
+
final Jar jar = (Jar) getProject().createTask( "jar" );
jar.setTaskName( getTaskName() );
- jar.setDestFile( jarFile );
+ jar.setDestFile( temp );
jar.setBasedir( classes );
jar.setIndex( true );
addManifest( jar );
jar.init();
jar.execute();
+
+ File dest = getDestination();
+ final File dir = dest.getParentFile();
+ mkDir( dir );

- return jarFile.lastModified() > modified;
+ final Copy copy = (Copy) getProject().createTask( "copy" );
+ copy.setTaskName( getTaskName() );
+ copy.setFile( temp );
+ copy.setTofile( dest );
+ copy.init();
+ copy.execute();
+
+ return dest;
}

+ private File getTempFile()
+ {
+ final File target = getContext().getTargetDirectory();
+ final String path = getTempFilename();
+ return new File( target, path );
+ }
+
+ private String getTempFilename()
+ {
+ Resource resource = getResource();
+ String name = resource.getName();
+ Version version = resource.getDecimalVersion();
+ if( null != version )
+ {
+ return name + "-" + version.toString() + ".jar";
+ }
+ else
+ {
+ String spec = resource.getVersion();
+ return name + "-" + spec + ".jar";
+ }
+ }
+
private Type getType()
{
Resource resource = getResource();
@@ -217,8 +243,12 @@
addAttribute( main, "Implementation-Vendor-Id",
implementationVendorID );
}

- final String implementationVersion = resource.getVersion();
- addAttribute( main, "Implementation-Version",
implementationVersion );
+ final Version spec = resource.getDecimalVersion();
+ if( null != spec )
+ {
+ String implementationVersion = spec.toString();
+ addAttribute( main, "Implementation-Version",
implementationVersion );
+ }

jar.addConfiguredManifest( manifest );
}

Modified: trunk/main/lang/module/etc/module.xsd
===================================================================
--- trunk/main/lang/module/etc/module.xsd 2006-07-31 03:31:13 UTC (rev
1699)
+++ trunk/main/lang/module/etc/module.xsd 2006-08-01 07:48:52 UTC (rev
1700)
@@ -207,6 +207,7 @@
<enumeration value="name"/>
<enumeration value="group"/>
<enumeration value="version"/>
+ <enumeration value="decimal"/>
<enumeration value="uri"/>
<enumeration value="spec"/>
<enumeration value="path"/>




  • r1700 - in trunk: . central/site/src/docs/about/download central/site/src/docs/util/cli main main/depot/library/src/main/net/dpml/library main/depot/library/src/main/net/dpml/library/impl main/depot/tools/src/main/net/dpml/tools/tasks main/lang/module/etc, mcconnell at BerliOS, 08/01/2006

Archive powered by MHonArc 2.6.24.

Top of Page