|
Version Number Creation Hell
Last post 04-16-2012 12:05 PM by ASheridan. 29 replies.
-
04-13-2012 1:09 PM
|
|
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Version Number Creation Hell
So, the boss asked me to change the structure of the version information displayed in the about box. Previously, it showed date information. We need to move to a more version-number way for reasons that don't really matter.
So, I start digging. public void showAboutBox() {
Properties version_props = new Properties();
String file_name = System.getProperty("APP_HOME", "/prod/app") + "/" + "release.info";
try {
version_props.load(new FileInputStream(file_name));
} catch (Exception e) {
e.printStackTrace();
}
String about = ABOUT_MESSAGE + version_props.getProperty("Release_Identifier", "no version found");
Utilities.showInternalMessageDialog(this, about, "About App", JOptionPane.INFORMATION_MESSAGE);
}
Um ... okay ... so, where does this "release.info" file get created? Ant config, probably? Aha, yes! build.xml: <target name="release-info" depends="init">
<exec executable="cvs" output="temp1.fil">
<arg value="log" />
<arg value="${basedir}/build.xml" />
</exec>
<exec executable="grep" output="temp2.fil">
<arg value="-v" />
<arg value="candidate_release_" />
<arg value="temp1.fil" />
</exec>
<exec executable="grep" output="temp1.fil">
<arg value="release_" />
<arg value="temp2.fil" />
<exec>
<exec executable="sed" output="temp2.fil">
<arg value="-e" />
<arg value="s/^.*release_/release_/;s/:.*$//" />
<arg value="temp1.fil" />
</exec>
<exec executable="nawk" output="temp1.fil">
<arg value="BEGIN{x=0};{x++;if(x==1) print $0}" />
<arg value="temp2.fil" />
</exec>
<loadfile srcFile="${basedir}/temp1.fil" property="releaseId">
<filterchain>
<filterreader classname="org.apache.tools.ant.filters.LineContainsRegExp">
<param type="regexp" value="release_[0-9][0-9][0-9][0-9]_[0-9][0-9]_[0-9][0-9]" />
</filterreader>
</filterchain>
</loadfile>
<echo
message="Project Name: ${project}${line.separator}"
file="${dist}/release.info" />
<echo
message="Release_Identifier=${releaseId}"
file="${dist}/release.info"
append="true" />
<echo
message="Build Timestamp: "
file="${dist}/release.info"
append="true" />
<exec executable="date" output="${dist}/release.info" append="true" />
<delete file="temp1.fil" verbose="false" />
<delete file="temp2.fil" verbose="true" />
<exec executable="cat" output="${dist}/application.info">
<arg value="${dist}/release.info" />
<arg value="${lib.dist}/release.info" />
</exec>
</target>
:headdesk:
Essentially, search for the first tag in CVS, strip off the 'release' word and stuff it into the release ID and create the file with that info?
So, if I don't want to break these fragile relationships, I change the regex in the filterreader to recognize [0-9].[0-9],[0-9], start using that format in the tags, and I'm done?
But what if I want to overhaul this whole process? How do you guys do this kind of thing? There's got to be a simpler way to do this, right?
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
That is heinous. Ant is good for some things but when you're doing shell scripting in it you should ask yourself "Is there a better way"?
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
Jaime


- Joined on 12-24-2009
- Posts 748
|
Re: Version Number Creation Hell
zelmak:But what if I want to overhaul this whole process? How do you guys do this kind of thing? There's got to be a simpler way to do this, right?
Our repository is set up as a trunk that we release from and project/feature branches, so we keep a file in the repository that represents the major and minor versions and another file with the build number. The build script increments number in the build number file and then major and minor version numbers are modified by hand. Our version number format is Mojor.Minor.Build.Revision with "Revision" being the SubVersion revision number of the latest change to that project in the repository.
|
|
-
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Re: Version Number Creation Hell
They're wanting to move from Solaris to Windows, client-side.
I'm waiting to yell and scream when they want us to move development to Windows as well.
Recently, I created a ticket to have a java -> c-shell -> sqlplus -> database process (with requisite hard-coded passwords in the shell script) changed to a java -> database process.
Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
|
|
-
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Re: Version Number Creation Hell
Jaime:
zelmak:But what if I want to overhaul this whole process? How do you guys do this kind of thing? There's got to be a simpler way to do this, right?
Our repository is set up as a trunk that we release from and project/feature branches, so we keep a file in the repository that represents the major and minor versions and another file with the build number. The build script increments number in the build number file and then major and minor version numbers are modified by hand. Our version number format is Mojor.Minor.Build.Revision with "Revision" being the SubVersion revision number of the latest change to that project in the repository.
Sadly, I've yet to figure out how to get a single magic number from CVS ... since version numbers are on individual files instead of the repository / project as a whole. How ugly is your build script which increments this number? Does it sit and wait for user input for the major/minor numbers or do you have to edit (and commit) the file before the build process?
|
|
-
-
Jaime


- Joined on 12-24-2009
- Posts 748
|
Re: Version Number Creation Hell
zelmak:How ugly is your build script which increments this number? Does it sit and wait for user input for the major/minor numbers or do you have to edit (and commit) the file before the build process?
We manually edit and commit the major/minor number. The script is medium-ugly, but that's mostly due to the fact that we build shared libraries from source, so every build has five or more versioned files, all with different version numbers. The main output always increments the build number, but shared outputs only increment the build number if there has been a commit since the last build. That way the same source always maps to the same version number.
|
|
-
-
sprained


- Joined on 09-06-2008
- Posts 97
|
Re: Version Number Creation Hell
I just feel sorry for you that you're still using CVS in this day and age. WTF?
|
|
-
-
blakeyrat


- Joined on 10-29-2008
- Posts 8,614
|
Re: Version Number Creation Hell
zelmak:Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I'm the most sane person on this board. Now excuse me while I spend 6 hours trying to get my cat to pose in her My Little Ponies outfit, so I can add that as a shield icon in Skyrim.
 <- I couldn't make my shit work, so here's a Godzilla head. "There is no such thing as a diet." - Lorne Kates
|
|
-
-
PJH


- Joined on 02-14-2007
- Newcastle, UK
- Posts 3,140
|
Re: Version Number Creation Hell
zelmak:
Morbs / Blakey ... where (geographically) do you work and are there openings?
As insane as either of you are, it would feel like Eden working in/around
your environment compared to here.
I, for some reason, feel you're missing out Snoofle in your requirements document....
3 logicians go into a bar.; the barman says ‘Would you all like a drink?’. The first says 'I’m not sure', the second says 'I’m not sure', and the third says 'Yes'.
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
zelmak:Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I work for a Bay Area company. I'm in the middle of relocating permanently to one of the two non-contiguous states. I have a place to live but I still have to take care of some stuff where I'm living now.
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
blakeyrat


- Joined on 10-29-2008
- Posts 8,614
|
Re: Version Number Creation Hell
morbiuswilters: zelmak:Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I work for a Bay Area company. I'm in the middle of relocating permanently to one of the two non-contiguous states. I have a place to live but I still have to take care of some stuff where I'm living now.
The one that Microsoft Flight models, or the one with polar bears?
 <- I couldn't make my shit work, so here's a Godzilla head. "There is no such thing as a diet." - Lorne Kates
|
|
-
-
TheCPUWizard


- Joined on 04-07-2010
- Posts 726
|
Re: Version Number Creation Hell
morbiuswilters: zelmak:Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I work for a Bay Area company. I'm in the middle of relocating permanently to one of the two non-contiguous states. I have a place to live but I still have to take care of some stuff where I'm living now.
Hey, Im based out of NY, but have been stuck in Milpitas for the past 6 months (just outside San Jose for those not familiar). I have family who until recently lived in HAwaii (my assumption as to where you are going) and have spend time in Alaska (great to visit...but...) myself.
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
blakeyrat: morbiuswilters: zelmak:Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I work for a Bay Area company. I'm in the middle of relocating permanently to one of the two non-contiguous states. I have a place to live but I still have to take care of some stuff where I'm living now.
The one that Microsoft Flight models, or the one with polar bears?
The one from which you cannot see Russia.
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
TheCPUWizard:Hey, Im based out of NY
I used to be based out of Cambridge but decided to look for jobs closer to the non-contiguous state I would be moving to.
TheCPUWizard:I have family who until recently lived in HAwaii
Which island?
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
TheCPUWizard


- Joined on 04-07-2010
- Posts 726
|
Re: Version Number Creation Hell
morbiuswilters: TheCPUWizard:Hey, Im based out of NY
I used to be based out of Cambridge but decided to look for jobs closer to the non-contiguous state I would be moving to.
TheCPUWizard:I have family who until recently lived in HAwaii
Which island?
Maui, in Kihei (athough for a time they live in Lahaina)
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
TheCPUWizard:Maui, in Kihei (athough for a time they live in Lahaina)
Ah, I love Lahaina; it's probably my second favorite town after Paia. They're all nice, though.
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
locallunatic


- Joined on 05-19-2010
- (YourLocation==USA-KY?local:MisleadingUsername)
- Posts 489
|
Re: Version Number Creation Hell
TheCPUWizard:spend time in Alaska (great to visit...but...) AK is an awesome place to live, plus it would help most on this board blend in as their crazy wouldn't stand out as much.
|
|
-
-
TheCPUWizard


- Joined on 04-07-2010
- Posts 726
|
Re: Version Number Creation Hell
locallunatic: TheCPUWizard:spend time in Alaska (great to visit...but...) AK is an awesome place to live, plus it would help most on this board blend in as their crazy wouldn't stand out as much.
My sister is moving up there (just outside Anchorage) next year... Personally I like the "faster pace", which is why I will probably never move out of Manhattan (again).
|
|
-
-
locallunatic


- Joined on 05-19-2010
- (YourLocation==USA-KY?local:MisleadingUsername)
- Posts 489
|
Re: Version Number Creation Hell
TheCPUWizard:My sister is moving up there (just outside Anchorage) next year Oh? Which direction from Anchortown, Girdwood or Eagle River/Wasilla/Palmer way?
|
|
-
-
TheCPUWizard


- Joined on 04-07-2010
- Posts 726
|
Re: Version Number Creation Hell
locallunatic: TheCPUWizard:My sister is moving up there (just outside Anchorage) next year Oh? Which direction from Anchortown, Girdwood or Eagle River/Wasilla/Palmer way?
Not exactly known. She is a teacher and there are opportunities up in that area. Location will depend on where she gets hired.
|
|
-
-
locallunatic


- Joined on 05-19-2010
- (YourLocation==USA-KY?local:MisleadingUsername)
- Posts 489
|
Re: Version Number Creation Hell
TheCPUWizard:Not exactly known. She is a teacher and there are opportunities up in that area. Location will depend on where she gets hired. Then if not in Anchorage but close by it's almost certainly going to be Eagle River/Wasilla/Palmer way, Girdwood is too small to have many spots and is right at the foot of a good slope so I'm sure there is fighting over any spots there. Of course it could also be Alaska close by and not lower 48 close in which case the options expand a lot.
|
|
-
-
blakeyrat


- Joined on 10-29-2008
- Posts 8,614
|
Re: Version Number Creation Hell
morbiuswilters:The one from which you cannot see Russia.
Hope you enjoy spam. And sushi made from spam.
 <- I couldn't make my shit work, so here's a Godzilla head. "There is no such thing as a diet." - Lorne Kates
|
|
-
-
morbiuswilters


- Joined on 01-15-2008
- In the face of every Euchlidon...
- Posts 9,005
|
Re: Version Number Creation Hell
blakeyrat: morbiuswilters:The one from which you cannot see Russia.
Hope you enjoy spam. And sushi made from spam.
I find their love of Spam amusing, but no, I probably won't be eating any. I've never actually had it but even when I ate meat it didn't look appetizing.
 "I confess. I've always been a humorist. It is not an accident that the Flounder is usually shown with a smile."
|
|
-
-
Cad Delworth


- Joined on 02-07-2010
- Edinburgh, Scotland
- Posts 278
|
Re: Version Number Creation Hell
morbiuswilters:I've never actually had it but even when I ate meat it didn't look appetizing.
I've eaten SPAM quite a few times. You can of course just slice it and put it in a sandwich as-is, but it definitely tastes best after gentle shallow-frying over a medium to low heat until it's turned golden on the outside. I'm not trying to pretend it's as good as (say) a gammon steak, but it's not the worst thing I've ever eaten, either.
|
|
-
-
BC_Programmer


- Joined on 10-08-2009
- Posts 231
|
Re: Version Number Creation Hell
blakeyrat:I'm the most sane person on this board. Now excuse me while I spend 6 hours trying to get my cat to pose in her My Little Ponies outfit, so I can add that as a shield icon in Skyrim.
It's easier if you just use the cat's skin.
|
|
-
-
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Re: Version Number Creation Hell
PJH: zelmak:
Morbs / Blakey ... where (geographically) do you work and are there openings? As insane as either of you are, it would feel like Eden working in/around your environment compared to here.
I, for some reason, feel you're missing out Snoofle in your requirements document....
No no ... those people are bat-shit crazy.
Oh, wait ... hrm ...
No, I think they're still crazier at snoofle's place of work. The problem here is a 'too many cooks, with no design over 12 years' problem ...
|
|
-
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Re: Version Number Creation Hell
morbiuswilters: TheCPUWizard:Hey, Im based out of NY
I used to be based out of Cambridge but decided to look for jobs closer to the non-contiguous state I would be moving to. TheCPUWizard:I have family who until recently lived in HAwaii
Which island?
I was on Oahu for three years at Hickam. (I'm retired USAF.)
|
|
-
-
zelmak


- Joined on 07-14-2010
- Posts 408
|
Re: Version Number Creation Hell
Oh, and thanks all for your hints how to overhaul our process.
|
|
-
-
ASheridan


- Joined on 11-23-2010
- Posts 433
|
Re: Version Number Creation Hell
blakeyrat:Now excuse me while I spend 6 hours trying to get my cat to pose in her My Little Ponies outfit, so I can add that as a shield icon in Skyrim. They make those in cat sizes?!
|
|
Page 1 of 1 (30 items)
|
|
|