Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
4fd57774
Commit
4fd57774
authored
9 years ago
by
Oz Linden
Browse files
Options
Downloads
Patches
Plain Diff
OPEN-297 simplify build number generation
parent
aa4d2891
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/contributions.txt
+1
-0
1 addition, 0 deletions
doc/contributions.txt
indra/cmake/BuildVersion.cmake
+26
-20
26 additions, 20 deletions
indra/cmake/BuildVersion.cmake
with
27 additions
and
20 deletions
doc/contributions.txt
+
1
−
0
View file @
4fd57774
...
@@ -319,6 +319,7 @@ Cinder Roxley
...
@@ -319,6 +319,7 @@ Cinder Roxley
OPEN-185
OPEN-185
OPEN-282
OPEN-282
OPEN-292
OPEN-292
OPEN-297
STORM-1703
STORM-1703
STORM-1948
STORM-1948
STORM-1831
STORM-1831
...
...
This diff is collapsed.
Click to expand it.
indra/cmake/BuildVersion.cmake
+
26
−
20
View file @
4fd57774
...
@@ -15,27 +15,33 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
...
@@ -15,27 +15,33 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
message
(
"Revision (from environment):
${
VIEWER_VERSION_REVISION
}
"
)
message
(
"Revision (from environment):
${
VIEWER_VERSION_REVISION
}
"
)
else
(
DEFINED ENV{revision}
)
else
(
DEFINED ENV{revision}
)
find_program
(
MERCURIAL hg
)
find_program
(
MERCURIAL
find_program
(
WORDCOUNT wc
)
NAMES hg
find_program
(
SED sed
)
PATHS [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
if
(
DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED
)
PATH_SUFFIXES Mercurial
)
execute_process
(
mark_as_advanced
(
MERCURIAL
)
COMMAND
${
MERCURIAL
}
log -r tip:0 --template '\\n'
if
(
MERCURIAL
)
COMMAND
${
WORDCOUNT
}
-l
execute_process
(
COMMAND
${
MERCURIAL
}
identify --num --rev tip
COMMAND
${
SED
}
"s/ //g"
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
OUTPUT_VARIABLE VIEWER_VERSION_REVISION
RESULT_VARIABLE hg_id_result
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE hg_id_error
)
OUTPUT_VARIABLE VIEWER_VERSION_REVISION
if
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message
(
"Revision (from hg)
${
VIEWER_VERSION_REVISION
}
"
)
if
(
NOT
${
hg_id_result
}
EQUAL 0
)
else
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
message
(
SEND_ERROR
"Revision number generation failed with output:
\n
${
hg_id_error
}
"
)
message
(
"Revision not set (repository not found?); using 0"
)
else
(
NOT
${
hg_id_result
}
EQUAL 0
)
set
(
VIEWER_VERSION_REVISION 0
)
string
(
REGEX REPLACE
"[^0-9a-f]"
""
VIEWER_VERSION_REVISION
${
VIEWER_VERSION_REVISION
}
)
endif
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
endif
(
NOT
${
hg_id_result
}
EQUAL 0
)
else
(
DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED
)
if
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
message
(
"Revision not set: 'hg', 'wc' or 'sed' not found; using 0"
)
message
(
"Revision (from hg)
${
VIEWER_VERSION_REVISION
}
"
)
else
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
message
(
"Revision not set (repository not found?); using 0"
)
set
(
VIEWER_VERSION_REVISION 0
)
endif
(
"
${
VIEWER_VERSION_REVISION
}
"
MATCHES
"^[0-9]+$"
)
else
(
MERCURIAL
)
message
(
"Revision not set: mercurial not found; using 0"
)
set
(
VIEWER_VERSION_REVISION 0
)
set
(
VIEWER_VERSION_REVISION 0
)
endif
(
DEFINED
MERCURIAL
AND DEFINED WORDCOUNT AND DEFINED SED
)
endif
(
MERCURIAL
)
endif
(
DEFINED ENV{revision}
)
endif
(
DEFINED ENV{revision}
)
message
(
"Building '
${
VIEWER_CHANNEL
}
' Version
${
VIEWER_SHORT_VERSION
}
.
${
VIEWER_VERSION_REVISION
}
"
)
message
(
"Building '
${
VIEWER_CHANNEL
}
' Version
${
VIEWER_SHORT_VERSION
}
.
${
VIEWER_VERSION_REVISION
}
"
)
else
(
EXISTS
${
VIEWER_VERSION_BASE_FILE
}
)
else
(
EXISTS
${
VIEWER_VERSION_BASE_FILE
}
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment