Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bedtools2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
legacy
bedtools2
Commits
4c48f9a2
Commit
4c48f9a2
authored
13 years ago
by
Aaron
Browse files
Options
Downloads
Plain Diff
added @agordon's new versioning system
parents
58063534
8284dfb0
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
Makefile
+72
-11
72 additions, 11 deletions
Makefile
src/utils/version/version_release.txt
+5
-0
5 additions, 0 deletions
src/utils/version/version_release.txt
with
77 additions
and
11 deletions
Makefile
+
72
−
11
View file @
4c48f9a2
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
SHELL
:=
/bin/bash
-e
SHELL
:=
/bin/bash
-e
VERSION_FILE
=
./src/utils/version/version_git.h
VERSION_FILE
=
./src/utils/version/version_git.h
RELEASED_VERSION_FILE
=
./src/utils/version/version_release.txt
# define our object and binary directories
# define our object and binary directories
...
@@ -79,7 +80,7 @@ UTIL_SUBDIRS = $(SRC_DIR)/utils/bedFile \
...
@@ -79,7 +80,7 @@ UTIL_SUBDIRS = $(SRC_DIR)/utils/bedFile \
BUILT_OBJECTS
=
$(
OBJ_DIR
)
/
*
.o
BUILT_OBJECTS
=
$(
OBJ_DIR
)
/
*
.o
all
:
print_banner $(OBJ_DIR) $(BIN_DIR) version $(UTIL_SUBDIRS) $(SUBDIRS)
all
:
print_banner $(OBJ_DIR) $(BIN_DIR)
auto
version $(UTIL_SUBDIRS) $(SUBDIRS)
@
echo
"- Building main bedtools binary."
@
echo
"- Building main bedtools binary."
@$(
CXX
)
$(
CXXFLAGS
)
-c
src/bedtools.cpp
-o
obj/bedtools.o
-I
$(
UTIL_DIR
)
/version/
@$(
CXX
)
$(
CXXFLAGS
)
-c
src/bedtools.cpp
-o
obj/bedtools.o
-I
$(
UTIL_DIR
)
/version/
@$(
CXX
)
$(
LDFLAGS
)
$(
CXXFLAGS
)
-o
$(
BIN_DIR
)
/bedtools
$(
BUILT_OBJECTS
)
-L
$(
UTIL_DIR
)
/BamTools/lib/
-lbamtools
$(
LIBS
)
@$(
CXX
)
$(
LDFLAGS
)
$(
CXXFLAGS
)
-o
$(
BIN_DIR
)
/bedtools
$(
BUILT_OBJECTS
)
-L
$(
UTIL_DIR
)
/BamTools/lib/
-lbamtools
$(
LIBS
)
...
@@ -128,15 +129,75 @@ test: all
...
@@ -128,15 +129,75 @@ test: all
.PHONY
:
test
.PHONY
:
test
.PHONY
:
version
version
:
## For BEDTools developers (not users):
@
(
BEDTOOLS_VERSION
=
""
;
\
## When you want to release (and tag) a new version, run:
[
-e
"
$(
VERSION_FILE
)
"
]
&&
BEDTOOLS_VERSION
=
$$(
grep
"define VERSION_GIT "
"
$(
VERSION_FILE
)
"
|
cut
-f3
-d
" "
|
sed
's/"//g'
)
;
\
## $ make setversion VERSION=v2.17.2
GIT_VERSION
=
$$(
git describe
--always
--tags
--dirty
)
;
\
## This will:
echo
"BEDTOOLS_VERSION =
$$
BEDTOOLS_VERSION"
;
\
## 1. Update the "/src/utils/version/version_release.txt" file
echo
"GIT_VERSION =
$$
GIT_VERSION"
;
\
## 2. Commit the file
if
[
"
$${
GIT_VERSION
}
"
!=
"
$${
BEDTOOLS_VERSION
}
"
]
;
then
\
## 3. Git-Tag the commit with the latest version
mkdir
-p
./src/utils/version
;
\
##
.PHONY
:
setversion
setversion
:
ifeq
"$(VERSION)" ""
$(
error
please
set
VERSION variable to the new version
(
e.g
"make setversion VERSION=v2.17.2"
))
endif
@echo
"# This file was auto-generated by running \"make setversion VERSION=$(VERSION)\""
>
"$(RELEASED_VERSION_FILE)"
@echo
"# on $$(date) ."
>>
"$(RELEASED_VERSION_FILE)"
@echo
"# Please do not edit or commit this file manually."
>>
"$(RELEASED_VERSION_FILE)"
@echo
"#"
>>
"$(RELEASED_VERSION_FILE)"
@echo
"$(VERSION)"
>>
$(RELEASED_VERSION_FILE)
@git
add
$(RELEASED_VERSION_FILE)
@git
commit
-q
-m
"Setting Release-Version $(VERSION)"
@git
tag
"$(VERSION)"
@echo
"Version updated to $(VERSION)."
@echo
""
@echo "Don't forget to push the commits AND the tags
:
"
@
echo
" git push --all --tags"
@
echo
""
## Automatic version detection
##
## What's going on here?
## 1. If there's a ".git" repository - use the version from the repository.
## ignore any released-version file. git repository is authorative.
##
## 2, If there's no ".git" repository,
## get the "released" version number from the release-version file.
##
## 2.1. If the current directory looks like "arq5x-bedtools-XXXXXXX",
## assume "-XXXXXX" is the last revision number (and the user
## probably downloaded the ZIP from github).
## Append the revision number to the released version string.
##
## 3. Compare the detected version (from steps 1,2) to the current string
## in ./src/utils/version/version_git.h .
## If they differ, update the header file - will cause a recompilation
## of version.o .
##
.PHONY
:
autoversion
autoversion
:
@
(
\
if
[
-d
".git"
]
&&
which git
>
/dev/null
;
then
\
DETECTED_VERSION
=
$$(
git describe
--always
--tags
--dirty
)
;
\
else
\
DETECTED_VERSION
=
$$(
grep
-v
"^#"
"
$(
RELEASED_VERSION_FILE
)
"
)
;
\
if
basename
$$(
pwd
)
|
grep
-q
"^[[:alnum:]]*-bedtools-[[:alnum:]]*
$$
"
;
then
\
DETECTED_VERSION
=
$${
DETECTED_VERSION
}
-zip-
$$(
basename
"
$$(
pwd
)
"
|
sed
's/^[[:alnum:]]*-bedtools-//'
)
;
\
fi
;
\
fi
;
\
\
CURRENT_VERSION
=
""
;
\
[
-e
"
$(
VERSION_FILE
)
"
]
&&
CURRENT_VERSION
=
$$(
grep
"define VERSION_GIT "
"
$(
VERSION_FILE
)
"
|
cut
-f3
-d
" "
|
sed
's/"//g'
)
;
\
\
echo
"DETECTED_VERSION =
$$
DETECTED_VERSION"
;
\
echo
"CURRENT_VERSION =
$$
CURRENT_VERSION"
;
\
if
[
"
$${
DETECTED_VERSION
}
"
!=
"
$${
CURRENT_VERSION
}
"
]
;
then
\
echo
"Updating version file."
;
\
echo
"Updating version file."
;
\
printf
"#ifndef VERSION_GIT_H
\n
#define VERSION_GIT_H
\n\n
#define VERSION_GIT
\"
$${
GIT_VERSION
}
\"\n\n
#endif /* VERSION_GIT_H */
\n
"
>
$(
VERSION_FILE
)
;
\
echo
"#ifndef VERSION_GIT_H"
>
$(
VERSION_FILE
)
;
\
echo
"#define VERSION_GIT_H"
>>
$(
VERSION_FILE
)
;
\
echo
"#define VERSION_GIT
\"
$${
DETECTED_VERSION
}
\"
"
>>
$(
VERSION_FILE
)
;
\
echo
"#endif /* VERSION_GIT_H */"
>>
$(
VERSION_FILE
)
;
\
fi
)
fi
)
This diff is collapsed.
Click to expand it.
src/utils/version/version_release.txt
0 → 100644
+
5
−
0
View file @
4c48f9a2
# This file was auto-generated by running "make setversion VERSION=v2.16.0.tagTest"
# on Fri Mar 9 13:50:40 EST 2012 .
# Please do not edit or commit this file manually.
#
v2.16.0.tagTest
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