dev@grizzly.java.net

Re: svn commit: r641 - trunk/modules/grizzly/src/main/java/com/sun/grizzly/Grizzly.java

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 30 Nov 2007 11:31:42 -0500

charlie hunt wrote:
> An RFE (request for enhancement) ;-)
>
> Can get this setup so that the Grizzly major and minor versions are
> inserted into the Grizzly.java source file at Grizzly build time?

yes, I'm implementing Shing-Wai recommendation (inject the version using
an ant task).

>
> In other words, have the maven build task insert, or potentially
> generate the Grizzly.java source file with a Grizzly major and minor
> version number pulled from a configuration file such as a
> "grizzly-framework-version.txt" file ?

Better, the pom file has the version in it so I will use it for injection.

A+

-- Jeanfrancois

>
> Then, when a version is released, the grizzly-framework-version.txt file
> is updated in the trunk.
>
> charlie ...
>
> oleksiys_at_dev.java.net wrote:
>> Author: oleksiys
>> Date: 2007-11-30 10:48:31+0000
>> New Revision: 641
>>
>> Added:
>> trunk/modules/grizzly/src/main/java/com/sun/grizzly/Grizzly.java
>>
>> Log:
>> Runtime Grizzly framework version info
>>
>> Added: trunk/modules/grizzly/src/main/java/com/sun/grizzly/Grizzly.java
>> Url:
>> https://grizzly.dev.java.net/source/browse/grizzly/trunk/modules/grizzly/src/main/java/com/sun/grizzly/Grizzly.java?view=auto&rev=641
>>
>> ==============================================================================
>>
>> --- (empty file)
>> +++
>> trunk/modules/grizzly/src/main/java/com/sun/grizzly/Grizzly.java
>> 2007-11-30 10:48:31+0000
>> @@ -0,0 +1,64 @@
>> +/*
>> + * The contents of this file are subject to the terms
>> + * of the Common Development and Distribution License
>> + * (the License). You may not use this file except in
>> + * compliance with the License.
>> + *
>> + * You can obtain a copy of the license at
>> + * https://glassfish.dev.java.net/public/CDDLv1.0.html or
>> + * glassfish/bootstrap/legal/CDDLv1.0.txt.
>> + * See the License for the specific language governing
>> + * permissions and limitations under the License.
>> + *
>> + * When distributing Covered Code, include this CDDL
>> + * Header Notice in each file and include the License file
>> + * at glassfish/bootstrap/legal/CDDLv1.0.txt.
>> + * If applicable, add the following below the CDDL Header,
>> + * with the fields enclosed by brackets [] replaced by
>> + * you own identifying information:
>> + * "Portions Copyrighted [year] [name of copyright owner]"
>> + *
>> + * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
>> + */
>> +
>> +package com.sun.grizzly;
>> +
>> +/**
>> + * Class contains information about Grizzly framework
>> + * + * @author Charlie Hunt
>> + */
>> +public class Grizzly {
>> +
>> + private static final int major = 1;
>> + private static final int minor = 6;
>> +
>> + /**
>> + * Get Grizzly framework major version
>> + * + * @return Grizzly framework major version
>> + */
>> + public static int getMajorVersion() {
>> + return major;
>> + }
>> + + /**
>> + * Get Grizzly framework minor version
>> + * + * @return Grizzly framework minor version
>> + */
>> + public static int getMinorVersion(){
>> + return minor;
>> + }
>> + + /**
>> + * Checks if current Grizzly framework version equals to one passed
>> + * + * @param major Grizzly framework major version
>> + * @param minor Grizzly framework minor version
>> + * @return true, if versions are equal; false otherwise
>> + */
>> + public static boolean equalVersion(int major, int minor) {
>> + return minor == Grizzly.minor && major == Grizzly.major;
>> + } +}
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commits-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: commits-help_at_grizzly.dev.java.net
>>
>>
>