Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #84/fix version number #87

Merged
merged 5 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/build_generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ jobs:
cache-to: type=gha,mode=max,scope=${{ inputs.distribution }}
load: true

- name: Build rDock
run: docker run --rm -v $PWD:/rdock -w /rdock rdock-${{ inputs.distribution }}:base make CXX=${{ inputs.compiler }} -j 2

- name: Test rDock
run: docker run --rm -v $PWD:/rdock -w /rdock rdock-${{ inputs.distribution }}:base make CXX=${{ inputs.compiler }} test
- name: Set version
id: set_version
run: echo "RBT_VERSION=$(date +%y.%m).${{ github.run_number }}" >> "$GITHUB_OUTPUT"

- name: Set candidate name
id: set_candidate_name
run: echo "CANDIDATE_NAME=$(date +%y.%m).${{ github.run_number }}_${{ inputs.distribution }}_${{ inputs.compiler }}_${{ inputs.arch }}" >> "$GITHUB_OUTPUT"

- name: Build rDock
run: docker run --rm -v $PWD:/rdock -w /rdock rdock-${{ inputs.distribution }}:base make CXX=${{ inputs.compiler }} RBT_VERSION=v${{ steps.set_version.outputs.RBT_VERSION }} -j 2

- name: Test rDock
run: docker run --rm -v $PWD:/rdock -w /rdock rdock-${{ inputs.distribution }}:base make CXX=${{ inputs.compiler }} test

- name: Create bundle
run: |
tar -czvf rdock-${{ steps.set_candidate_name.outputs.CANDIDATE_NAME }}.tar.gz \
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

PREFIX ?= /usr
CONFIG ?= RELEASE
RBT_VERSION ?= v$(shell date +%y.%m-alpha)
CXX ?= g++

LEGACY_BUILD ?= NO
Expand Down Expand Up @@ -75,6 +76,7 @@ else
DEFINES += $(RELEASE_DEFINES)
endif

DEFINES += -DRBT_VERSION=\"$(RBT_VERSION)\"
CXX_FLAGS := $(CXX_BASE_FLAGS) $(CXX_CONFIG_FLAGS) $(CXX_WARNING_FLAGS) $(CXX_EXTRA_FLAGS) $(DEFINES)
LINK_FLAGS := -shared
LIB_DEPENDENCIES := -lpopt -lm -lstdc++
Expand Down
6 changes: 6 additions & 0 deletions include/RbtVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _RBT_VERSION_H_
#define _RBT_VERSION_H_
#ifndef RBT_VERSION
#define RBT_VERSION "v00.00.unknown"
#endif
#endif //_RBT_VERSION_H_
5 changes: 3 additions & 2 deletions src/exe/rbcalcgrid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
#include "RbtRealGrid.h"
#include "RbtSFFactory.h"
#include "RbtTriposAtomType.h"
#include "RbtVersion.h"

const RbtString EXEVERSION = " ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbcalcgrid.cxx#3 $)";
const RbtString EXEVERSION = RBT_VERSION;
const RbtString _ROOT_SF = "SCORE";

// Creates list of probe models
Expand Down Expand Up @@ -90,7 +91,7 @@ int main(int argc, char* argv[]) {
if (i != RbtString::npos) strExeName.erase(0, i + 1);

// Print a standard header
Rbt::PrintStdHeader(cout, strExeName + EXEVERSION);
Rbt::PrintStdHeader(cout, strExeName + " - " + EXEVERSION);

// Command line arguments and default values
RbtString strSuffix(".grd");
Expand Down
5 changes: 3 additions & 2 deletions src/exe/rbcavity.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ using std::setw;
#include "RbtParameterFileSource.h"
#include "RbtPsfFileSink.h"
#include "RbtSiteMapperFactory.h"
#include "RbtVersion.h"

const RbtString EXEVERSION = " ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbcavity.cxx#3 $)";
const RbtString EXEVERSION = RBT_VERSION;

void PrintUsage(void) {
cout << "rbcavity - calculate docking cavities" << endl;
Expand Down Expand Up @@ -85,7 +86,7 @@ int main(int argc, const char *argv[]) {
if (i != RbtString::npos) strExeName.erase(0, i + 1);

// Print a standard header
Rbt::PrintStdHeader(cout, strExeName + EXEVERSION);
Rbt::PrintStdHeader(cout, strExeName + " - " + EXEVERSION);

// Command line arguments and default values
RbtString strReceptorPrmFile;
Expand Down
7 changes: 4 additions & 3 deletions src/exe/rbdock.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ using std::setw;
#include "RbtSFFactory.h"
#include "RbtSFRequest.h"
#include "RbtTransformFactory.h"
#include "RbtVersion.h"

const RbtString EXEVERSION = " ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbdock.cxx#4 $)";
const RbtString EXEVERSION = RBT_VERSION;
// Section name in docking prm file containing scoring function definition
const RbtString _ROOT_SF = "SCORE";
const RbtString _RESTRAINT_SF = "RESTR";
Expand Down Expand Up @@ -72,7 +73,7 @@ int main(int argc, const char *argv[]) {
if (i != RbtString::npos) strExeName.erase(0, i + 1);

// Print a standard header
Rbt::PrintStdHeader(cout, strExeName + EXEVERSION);
Rbt::PrintStdHeader(cout, strExeName + " - " + EXEVERSION);

// Command line arguments and default values
RbtString strLigandMdlFile;
Expand Down Expand Up @@ -344,7 +345,7 @@ int main(int argc, const char *argv[]) {
// Variants describing the library version, exe version, parameter file, and current directory
// Will be stored in the ligand SD files
RbtVariant vLib(Rbt::GetProduct() + " (" + Rbt::GetVersion() + ", Build" + Rbt::GetBuild() + ")");
RbtVariant vExe(strExeName + EXEVERSION);
RbtVariant vExe(strExeName + " - " + EXEVERSION);
RbtVariant vRecep(spRecepPrmSource->GetFileName());
RbtVariant vPrm(spParamSource->GetFileName());
RbtVariant vDir(Rbt::GetCurrentDirectory());
Expand Down
6 changes: 4 additions & 2 deletions src/exe/rblist.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#include <algorithm> //for min,max
#include <iomanip>
using namespace std;

#include "RbtMdlFileSink.h"
#include "RbtMdlFileSource.h"
#include "RbtVersion.h"

const RbtString EXEVERSION = " ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rblist.cxx#4 $)";
const RbtString EXEVERSION = RBT_VERSION;

namespace Rbt {
class isAtomNitroN: public std::unary_function<RbtAtomPtr, RbtBool> {
Expand Down Expand Up @@ -113,7 +115,7 @@ int main(int argc, char* argv[]) {
if (i != RbtString::npos) strExeName.erase(0, i + 1);

// Print a standard header
Rbt::PrintStdHeader(cout, strExeName + EXEVERSION);
Rbt::PrintStdHeader(cout, strExeName + " - " + EXEVERSION);

// Default values for optional arguments
RbtString strInputSDFile;
Expand Down
3 changes: 2 additions & 1 deletion src/exe/rbmoegrid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#include "RbtRealGrid.h"
#include "RbtSFFactory.h"
#include "RbtTriposAtomType.h"
#include "RbtVersion.h"

const RbtString EXEVERSION = " ($Id: //depot/dev/client3/rdock/2021.1/src/exe/rbmoegrid.cxx#4 $)";
const RbtString EXEVERSION = RBT_VERSION;
const RbtString _ROOT_SF = "SCORE";

// Creates list of probe models
Expand Down
7 changes: 5 additions & 2 deletions src/lib/Rbt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ RbtString Rbt::GetRbtHome() {

// Rbt::GetCopyright - returns legalese statement
RbtString Rbt::GetCopyright() { return IDS_COPYRIGHT; }
// current version format is 'v<year>.<month>.<build_number>' so we can extract the version number
// by taking the substring from the second character to the 5th character
// Rbt::GetVersion - returns current library version
RbtString Rbt::GetVersion() { return IDS_VERSION; }
RbtString Rbt::GetVersion() { return std::string(RBT_VERSION).substr(1, 5); }
// same as above for the build number, but we take the substring from the 7th character to the end
// GetBuildNum - returns current library build number
RbtString Rbt::GetBuild() { return IDS_BUILDNUM; }
RbtString Rbt::GetBuild() { return std::string(RBT_VERSION).substr(7); }
// GetProduct - returns library product name
RbtString Rbt::GetProduct() { return IDS_PRODUCT; }
// GetTime - returns current time as an RbtString
Expand Down
Loading