mirror of
https://github.com/rehlds/reapi.git
synced 2025-03-31 22:59:16 +03:00
Refactoring versioning
This commit is contained in:
parent
5fffe5368a
commit
05a5f1686e
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,3 +16,4 @@
|
|||||||
|
|
||||||
publish
|
publish
|
||||||
**/appversion.h
|
**/appversion.h
|
||||||
|
**/reapi_version.inc
|
||||||
|
26
build.gradle
26
build.gradle
@ -1,5 +1,6 @@
|
|||||||
import versioning.GitVersioner
|
import versioning.GitVersioner
|
||||||
import versioning.ReapiVersionInfo
|
import versioning.ReapiVersionInfo
|
||||||
|
import org.joda.time.DateTime
|
||||||
|
|
||||||
apply from: 'shared.gradle'
|
apply from: 'shared.gradle'
|
||||||
group = 'reapi'
|
group = 'reapi'
|
||||||
@ -13,13 +14,8 @@ idea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def gitInfo = GitVersioner.versionForDir(project.rootDir)
|
def gitInfo = GitVersioner.versionForDir(project.rootDir)
|
||||||
if (!gitInfo) {
|
|
||||||
throw new RuntimeException('Running outside git repository')
|
|
||||||
}
|
|
||||||
|
|
||||||
ReapiVersionInfo versionInfo
|
ReapiVersionInfo versionInfo
|
||||||
if (gitInfo.tag && gitInfo.tag[0] == 'v') {
|
if (gitInfo && gitInfo.tag && gitInfo.tag[0] == 'v') {
|
||||||
|
|
||||||
def m = gitInfo.tag =~ /^v(\d+)\.(\d+)(\.(\d+))?$/
|
def m = gitInfo.tag =~ /^v(\d+)\.(\d+)(\.(\d+))?$/
|
||||||
if (!m.find()) {
|
if (!m.find()) {
|
||||||
throw new RuntimeException("Invalid git version tag name ${gitInfo.tag}")
|
throw new RuntimeException("Invalid git version tag name ${gitInfo.tag}")
|
||||||
@ -29,22 +25,28 @@ if (gitInfo.tag && gitInfo.tag[0] == 'v') {
|
|||||||
majorVersion: m.group(1) as int,
|
majorVersion: m.group(1) as int,
|
||||||
minorVersion: m.group(2) as int,
|
minorVersion: m.group(2) as int,
|
||||||
maintenanceVersion: m.group(4) ? (m.group(4) as int) : null,
|
maintenanceVersion: m.group(4) ? (m.group(4) as int) : null,
|
||||||
countCommit: gitInfo.countCommit,
|
localChanges: gitInfo.localChanges,
|
||||||
lastCommitDate: gitInfo.lastCommitDate
|
commitDate: gitInfo.commitDate,
|
||||||
|
commitSHA: gitInfo.commitSHA,
|
||||||
|
commitURL: gitInfo.commitURL
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
versionInfo = new ReapiVersionInfo(
|
versionInfo = new ReapiVersionInfo(
|
||||||
majorVersion: project.majorVersion as int,
|
majorVersion: project.majorVersion as int,
|
||||||
minorVersion: project.minorVersion as int,
|
minorVersion: project.minorVersion as int,
|
||||||
specialVersion: project.specialVersion,
|
maintenanceVersion: project.maintenanceVersion as int,
|
||||||
countCommit: gitInfo.countCommit,
|
suffix: 'dev',
|
||||||
lastCommitDate: gitInfo.lastCommitDate
|
localChanges: gitInfo ? gitInfo.localChanges : true,
|
||||||
|
commitDate: gitInfo ? gitInfo.commitDate : new DateTime(),
|
||||||
|
commitSHA: gitInfo ? gitInfo.commitSHA : "",
|
||||||
|
commitURL: gitInfo ? gitInfo.commitURL : "",
|
||||||
|
commitCount: gitInfo ? (gitInfo.commitCount as int) : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
project.ext.reapiVersionInfo = versionInfo
|
project.ext.reapiVersionInfo = versionInfo
|
||||||
project.version = versionInfo.asVersion()
|
project.version = versionInfo.asMavenVersion()
|
||||||
|
|
||||||
apply from: 'publish.gradle'
|
apply from: 'publish.gradle'
|
||||||
|
|
||||||
|
@ -20,31 +20,13 @@ class VelocityUtils {
|
|||||||
|
|
||||||
Velocity.init(p);
|
Velocity.init(p);
|
||||||
}
|
}
|
||||||
static String renderTemplate(File tplFile, ReapiVersionInfo ctx) {
|
static String renderTemplate(File tplFile, Map<String, ? extends Object> ctx) {
|
||||||
Template tpl = Velocity.getTemplate(tplFile.absolutePath)
|
Template tpl = Velocity.getTemplate(tplFile.absolutePath)
|
||||||
if (!tpl) {
|
if (!tpl) {
|
||||||
throw new RuntimeException("Failed to load velocity template ${tplFile.absolutePath}: not found")
|
throw new RuntimeException("Failed to load velocity template ${tplFile.absolutePath}: not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
def templateCtx = [
|
def velocityContext = new VelocityContext(ctx)
|
||||||
verInfo: ctx
|
|
||||||
]
|
|
||||||
|
|
||||||
def velocityContext = new VelocityContext(templateCtx)
|
|
||||||
|
|
||||||
if (ctx.specialVersion.length() > 0) {
|
|
||||||
velocityContext.put("appFlags", 0x0L)
|
|
||||||
velocityContext.put("formatSpecialVersion", "-" + ctx.specialVersion)
|
|
||||||
} else {
|
|
||||||
|
|
||||||
velocityContext.put("appFlags", "VS_FF_SPECIALBUILD")
|
|
||||||
velocityContext.put("formatSpecialVersion", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
velocityContext.put("current_version", ctx.asVersion())
|
|
||||||
|
|
||||||
velocityContext.put("_DateTimeFormat", DateTimeFormat)
|
|
||||||
|
|
||||||
def sw = new StringWriter()
|
def sw = new StringWriter()
|
||||||
tpl.merge(velocityContext, sw)
|
tpl.merge(velocityContext, sw)
|
||||||
|
|
||||||
|
@ -6,8 +6,11 @@ import org.joda.time.DateTime
|
|||||||
|
|
||||||
@CompileStatic @TypeChecked
|
@CompileStatic @TypeChecked
|
||||||
class GitInfo {
|
class GitInfo {
|
||||||
DateTime lastCommitDate
|
boolean localChanges
|
||||||
|
DateTime commitDate
|
||||||
String branch
|
String branch
|
||||||
String tag
|
String tag
|
||||||
Integer countCommit
|
String commitSHA
|
||||||
|
String commitURL
|
||||||
|
Integer commitCount
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,10 @@ package versioning
|
|||||||
import groovy.transform.CompileStatic
|
import groovy.transform.CompileStatic
|
||||||
import groovy.transform.TypeChecked
|
import groovy.transform.TypeChecked
|
||||||
import org.eclipse.jgit.api.Git
|
import org.eclipse.jgit.api.Git
|
||||||
|
import org.eclipse.jgit.api.Status;
|
||||||
import org.eclipse.jgit.lib.ObjectId
|
import org.eclipse.jgit.lib.ObjectId
|
||||||
import org.eclipse.jgit.lib.Repository
|
import org.eclipse.jgit.lib.Repository
|
||||||
|
import org.eclipse.jgit.lib.StoredConfig
|
||||||
import org.eclipse.jgit.revwalk.RevCommit
|
import org.eclipse.jgit.revwalk.RevCommit
|
||||||
import org.eclipse.jgit.revwalk.RevWalk
|
import org.eclipse.jgit.revwalk.RevWalk
|
||||||
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
|
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
|
||||||
@ -26,28 +28,98 @@ class GitVersioner {
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
static String prepareUrlToCommits(String url) {
|
||||||
|
if (url == null) {
|
||||||
|
// default remote url
|
||||||
|
return "https://github.com/s1lentq/reapi/commit/";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String childPath;
|
||||||
|
int pos = url.indexOf('@');
|
||||||
|
if (pos != -1) {
|
||||||
|
childPath = url.substring(pos + 1, url.lastIndexOf('.git')).replace(':', '/');
|
||||||
|
sb.append('https://');
|
||||||
|
} else {
|
||||||
|
pos = url.lastIndexOf('.git');
|
||||||
|
childPath = (pos == -1) ? url : url.substring(0, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
// support for different links to history of commits
|
||||||
|
if (url.indexOf('bitbucket.org') != -1) {
|
||||||
|
sb.append(childPath).append('/commits/');
|
||||||
|
} else {
|
||||||
|
sb.append(childPath).append('/commit/');
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
// check uncommited changes
|
||||||
|
static boolean getUncommittedChanges(Repository repo) {
|
||||||
|
Git git = new Git(repo);
|
||||||
|
Status status = git.status().call();
|
||||||
|
|
||||||
|
Set<String> uncommittedChanges = status.getUncommittedChanges();
|
||||||
|
for(String uncommitted : uncommittedChanges) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static GitInfo versionForDir(File dir) {
|
static GitInfo versionForDir(File dir) {
|
||||||
FileRepositoryBuilder builder = new FileRepositoryBuilder()
|
FileRepositoryBuilder builder = new FileRepositoryBuilder()
|
||||||
Repository repo = builder.setWorkTree(dir).findGitDir().build()
|
Repository repo = builder.setWorkTree(dir)
|
||||||
|
.findGitDir()
|
||||||
|
.build()
|
||||||
|
|
||||||
ObjectId head = repo.resolve('HEAD')
|
ObjectId head = repo.resolve('HEAD')
|
||||||
if (!head) {
|
if (!head) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final StoredConfig cfg = repo.getConfig();
|
||||||
|
|
||||||
def commit = new RevWalk(repo).parseCommit(head)
|
def commit = new RevWalk(repo).parseCommit(head)
|
||||||
|
if (!commit) {
|
||||||
|
throw new RuntimeException("Can't find last commit.")
|
||||||
|
}
|
||||||
|
|
||||||
|
def localChanges = getUncommittedChanges(repo);
|
||||||
|
def commitDate = new DateTime(1000L * commit.commitTime, DateTimeZone.UTC);
|
||||||
|
if (localChanges) {
|
||||||
|
commitDate = new DateTime();
|
||||||
|
}
|
||||||
|
|
||||||
def branch = repo.getBranch()
|
def branch = repo.getBranch()
|
||||||
def commitDate = new DateTime(1000L * commit.commitTime, DateTimeZone.UTC)
|
|
||||||
|
|
||||||
int commitCount = getCountCommit(repo);
|
String url = null;
|
||||||
|
String remote_name = cfg.getString("branch", branch, "remote");
|
||||||
|
|
||||||
|
if (remote_name == null) {
|
||||||
|
for (String remotes : cfg.getSubsections("remote")) {
|
||||||
|
if (url != null) {
|
||||||
|
println 'Found a second remote: (' + remotes + '), url: (' + cfg.getString("remote", remotes, "url") + ')'
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
url = cfg.getString("remote", remotes, "url");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url = cfg.getString("remote", remote_name, "url");
|
||||||
|
}
|
||||||
|
|
||||||
|
String commitURL = prepareUrlToCommits(url);
|
||||||
String tag = repo.tags.find { kv -> kv.value.objectId == commit.id }?.key
|
String tag = repo.tags.find { kv -> kv.value.objectId == commit.id }?.key
|
||||||
|
String commitSHA = commit.getId().abbreviate(7).name();
|
||||||
|
|
||||||
return new GitInfo(
|
return new GitInfo(
|
||||||
lastCommitDate: commitDate,
|
localChanges: localChanges,
|
||||||
|
commitDate: commitDate,
|
||||||
branch: branch,
|
branch: branch,
|
||||||
tag: tag,
|
tag: tag,
|
||||||
countCommit: commitCount
|
commitSHA: commitSHA,
|
||||||
|
commitURL: commitURL,
|
||||||
|
commitCount: getCountCommit(repo)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package versioning
|
|||||||
import groovy.transform.CompileStatic
|
import groovy.transform.CompileStatic
|
||||||
import groovy.transform.ToString
|
import groovy.transform.ToString
|
||||||
import groovy.transform.TypeChecked
|
import groovy.transform.TypeChecked
|
||||||
|
import org.joda.time.format.DateTimeFormat
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
|
|
||||||
@CompileStatic @TypeChecked
|
@CompileStatic @TypeChecked
|
||||||
@ -11,31 +12,65 @@ class ReapiVersionInfo {
|
|||||||
int majorVersion
|
int majorVersion
|
||||||
int minorVersion
|
int minorVersion
|
||||||
Integer maintenanceVersion
|
Integer maintenanceVersion
|
||||||
String specialVersion
|
String suffix
|
||||||
Integer countCommit
|
|
||||||
DateTime lastCommitDate
|
|
||||||
|
|
||||||
String format(String versionSeparator, String suffixSeparator, boolean includeSuffix) {
|
boolean localChanges
|
||||||
|
DateTime commitDate
|
||||||
|
String commitSHA
|
||||||
|
String commitURL
|
||||||
|
Integer commitCount
|
||||||
|
|
||||||
|
String asReapiVersion() {
|
||||||
StringBuilder sb = new StringBuilder()
|
StringBuilder sb = new StringBuilder()
|
||||||
sb.append(majorVersion).append(versionSeparator).append(minorVersion)
|
sb.append(majorVersion).append(minorVersion).append(commitCount);
|
||||||
|
return sb.toString()
|
||||||
|
}
|
||||||
|
String asMavenVersionC() {
|
||||||
|
StringBuilder sb = new StringBuilder()
|
||||||
|
sb.append(majorVersion).append(',' + minorVersion);
|
||||||
if (maintenanceVersion != null) {
|
if (maintenanceVersion != null) {
|
||||||
sb.append(versionSeparator).append(maintenanceVersion)
|
sb.append(',' + maintenanceVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (specialVersion && includeSuffix) {
|
if (commitCount != null) {
|
||||||
sb.append(suffixSeparator).append(specialVersion)
|
sb.append(',' + commitCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString()
|
return sb.toString()
|
||||||
}
|
}
|
||||||
String asVersion() {
|
String asMavenVersion(boolean extra = true) {
|
||||||
if (specialVersion.length() > 0) {
|
StringBuilder sb = new StringBuilder()
|
||||||
sprintf("%d.%d.%d-%s", majorVersion, minorVersion, countCommit, specialVersion)
|
sb.append(majorVersion).append('.' + minorVersion);
|
||||||
|
if (maintenanceVersion != null) {
|
||||||
|
sb.append('.' + maintenanceVersion);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
sprintf("%d.%d.%d", majorVersion, minorVersion, countCommit)
|
if (commitCount != null) {
|
||||||
|
sb.append('.' + commitCount)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extra && suffix) {
|
||||||
|
sb.append('-' + suffix)
|
||||||
|
}
|
||||||
|
|
||||||
|
// do mark for this build like a modified version
|
||||||
|
if (extra && localChanges) {
|
||||||
|
sb.append('+m');
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString()
|
||||||
}
|
}
|
||||||
String asMavenVersion() {
|
String asCommitDate(String pattern = null) {
|
||||||
format('.', '-', true)
|
if (pattern == null) {
|
||||||
|
pattern = "MMM d yyyy";
|
||||||
|
if (commitDate.getDayOfMonth() >= 10) {
|
||||||
|
pattern = "MMM d yyyy";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DateTimeFormat.forPattern(pattern).withLocale(Locale.ENGLISH).print(commitDate);
|
||||||
|
}
|
||||||
|
String asCommitTime() {
|
||||||
|
return DateTimeFormat.forPattern('HH:mm:ss').withLocale(Locale.ENGLISH).print(commitDate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
majorVersion=0
|
majorVersion=5
|
||||||
minorVersion=1
|
minorVersion=0
|
||||||
specialVersion=
|
maintenanceVersion=0
|
||||||
|
@ -32,7 +32,7 @@ task publishPrepareFiles << {
|
|||||||
into 'publish/publishRoot/reapi/addons'
|
into 'publish/publishRoot/reapi/addons'
|
||||||
}
|
}
|
||||||
copy {
|
copy {
|
||||||
from 'reapi/src/reapi_version.inc'
|
from 'reapi/version/reapi_version.inc'
|
||||||
into 'publish/publishRoot/reapi/addons/amxmodx/scripting/include'
|
into 'publish/publishRoot/reapi/addons/amxmodx/scripting/include'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,22 +155,35 @@ task buildRelease {
|
|||||||
|
|
||||||
tasks.clean.doLast {
|
tasks.clean.doLast {
|
||||||
project.file('version/appversion.h').delete()
|
project.file('version/appversion.h').delete()
|
||||||
|
project.file('version/reapi_version.inc').delete()
|
||||||
}
|
}
|
||||||
|
|
||||||
task generateAppVersion {
|
task generateAppVersion {
|
||||||
|
|
||||||
ReapiVersionInfo verInfo = (ReapiVersionInfo) rootProject.reapiVersionInfo
|
ReapiVersionInfo verInfo = (ReapiVersionInfo) rootProject.reapiVersionInfo
|
||||||
|
def tplversionFileInc = project.file('version/reapi_version.vm')
|
||||||
|
def versionFileInc = project.file('version/reapi_version.inc')
|
||||||
|
|
||||||
def tplversionFile = project.file('version/appversion.vm')
|
def tplversionFile = project.file('version/appversion.vm')
|
||||||
def versionFile = project.file('version/appversion.h')
|
def versionFile = project.file('version/appversion.h')
|
||||||
|
|
||||||
inputs.file tplversionFile
|
inputs.file tplversionFile
|
||||||
|
inputs.file tplversionFileInc
|
||||||
inputs.file project.file('gradle.properties')
|
inputs.file project.file('gradle.properties')
|
||||||
outputs.file versionFile
|
outputs.file versionFile
|
||||||
|
outputs.file versionFileInc
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
|
def templateCtx = [
|
||||||
|
verInfo : verInfo
|
||||||
|
]
|
||||||
|
|
||||||
def versionContent = VelocityUtils.renderTemplate(tplversionFile, verInfo)
|
def versionContent = VelocityUtils.renderTemplate(tplversionFile, templateCtx)
|
||||||
versionFile.delete()
|
versionFile.delete()
|
||||||
versionFile.write(versionContent, 'utf-8')
|
versionFile.write(versionContent, 'utf-8')
|
||||||
|
|
||||||
|
def versionContentInc = VelocityUtils.renderTemplate(tplversionFileInc, templateCtx)
|
||||||
|
versionFileInc.delete()
|
||||||
|
versionFileInc.write(versionContentInc, 'utf-8')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,32 @@
|
|||||||
@echo OFF
|
@setlocal enableextensions enabledelayedexpansion
|
||||||
|
@echo off
|
||||||
::
|
::
|
||||||
:: Pre-build auto-versioning script
|
:: Pre-build auto-versioning script
|
||||||
::
|
::
|
||||||
|
|
||||||
SET srcdir=%~1
|
set srcdir=%~1
|
||||||
SET repodir=%~2
|
set repodir=%~2
|
||||||
|
|
||||||
SET old_version=
|
set old_version=
|
||||||
set old_specialbuild=""
|
set version_major=0
|
||||||
SET version_revision=0
|
set version_minor=0
|
||||||
set version_specialbuild=
|
set version_maintenance=0
|
||||||
SET version_pdate_1=%date:~-4%-%date:~3,2%-%date:~0,2%
|
set version_modifed=
|
||||||
SET version_pdate=%version_pdate_1% %time:~0,2%:%time:~3,2%:%time:~6,2%
|
|
||||||
SET version_date=%version_pdate_1%__%time:~0,2%-%time:~3,2%-%time:~6,2%
|
set commitSHA=
|
||||||
SET version_major=0
|
set commitURL=
|
||||||
SET version_minor=0
|
set commitCount=0
|
||||||
SET version_specialversion=
|
set branch_name=master
|
||||||
|
|
||||||
|
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
|
||||||
|
set "YYYY=%dt:~0,4%"
|
||||||
|
set "MM=%dt:~4,2%"
|
||||||
|
set "DD=%dt:~6,2%"
|
||||||
|
set "hour=%dt:~8,2%"
|
||||||
|
set "min=%dt:~10,2%"
|
||||||
|
set "sec=%dt:~12,2%"
|
||||||
|
|
||||||
|
for /f "tokens=%MM%" %%I in ("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") do set "month=%%I"
|
||||||
|
|
||||||
::
|
::
|
||||||
:: Check for git.exe presence
|
:: Check for git.exe presence
|
||||||
@ -29,8 +40,11 @@ set errlvl="%ERRORLEVEL%"
|
|||||||
IF EXIST "%srcdir%\appversion.h" (
|
IF EXIST "%srcdir%\appversion.h" (
|
||||||
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\appversion.h") do (
|
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\appversion.h") do (
|
||||||
IF %%i==#define (
|
IF %%i==#define (
|
||||||
IF %%j==APP_VERSION_C SET old_version=%%k
|
IF %%j==APP_VERSION (
|
||||||
IF %%j==APP_VERSION_SPECIALBUILD SET old_specialbuild=%%k
|
:: Remove quotes
|
||||||
|
set v=%%k
|
||||||
|
set old_version=!v:"=!
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -40,7 +54,7 @@ IF %errlvl% == "1" (
|
|||||||
|
|
||||||
:: if we haven't appversion.h, we need to create it
|
:: if we haven't appversion.h, we need to create it
|
||||||
IF NOT "%old_version%" == "" (
|
IF NOT "%old_version%" == "" (
|
||||||
SET version_revision=0
|
set commitCount=0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,17 +64,17 @@ IF %errlvl% == "1" (
|
|||||||
IF EXIST "%srcdir%\version.h" (
|
IF EXIST "%srcdir%\version.h" (
|
||||||
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\version.h") do (
|
FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\version.h") do (
|
||||||
IF %%i==#define (
|
IF %%i==#define (
|
||||||
IF %%j==VERSION_MAJOR SET version_major=%%k
|
IF %%j==VERSION_MAJOR set version_major=%%k
|
||||||
IF %%j==VERSION_MINOR SET version_minor=%%k
|
IF %%j==VERSION_MINOR set version_minor=%%k
|
||||||
IF %%j==VERSION_SPECIALVERSION SET version_specialversion=%%k
|
IF %%j==VERSION_MAINTENANCE set version_maintenance=%%k
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) ELSE (
|
) ELSE (
|
||||||
FOR /F "usebackq tokens=1,2,3,* delims==" %%i in ("%repodir%..\gradle.properties") do (
|
FOR /F "usebackq tokens=1,2,3,* delims==" %%i in ("%repodir%..\gradle.properties") do (
|
||||||
IF NOT [%%j] == [] (
|
IF NOT [%%j] == [] (
|
||||||
IF %%i==majorVersion SET version_major=%%j
|
IF %%i==majorVersion set version_major=%%j
|
||||||
IF %%i==minorVersion SET version_minor=%%j
|
IF %%i==minorVersion set version_minor=%%j
|
||||||
IF %%i==specialVersion SET version_specialversion=%%j
|
IF %%i==maintenanceVersion set version_maintenance=%%j
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -69,49 +83,118 @@ IF EXIST "%srcdir%\version.h" (
|
|||||||
:: Read revision and release date from it
|
:: Read revision and release date from it
|
||||||
::
|
::
|
||||||
IF NOT %errlvl% == "1" (
|
IF NOT %errlvl% == "1" (
|
||||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-list --all | wc -l"') DO (
|
:: Get current branch
|
||||||
|
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --abbrev-ref HEAD"') DO (
|
||||||
|
set branch_name=%%i
|
||||||
|
)
|
||||||
|
|
||||||
|
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-list --count !branch_name!"') DO (
|
||||||
IF NOT [%%i] == [] (
|
IF NOT [%%i] == [] (
|
||||||
set version_revision=%%i
|
set commitCount=%%i
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
::
|
::
|
||||||
:: Now form full version string like 1.0.0.1
|
:: Get remote url repository
|
||||||
::
|
::
|
||||||
|
IF NOT %errlvl% == "1" (
|
||||||
|
|
||||||
set new_version=%version_major%,%version_minor%,0,%version_revision%
|
set branch_remote=origin
|
||||||
|
:: Get remote name by current branch
|
||||||
|
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." config branch.!branch_name!.remote"') DO (
|
||||||
|
set branch_remote=%%i
|
||||||
|
)
|
||||||
|
:: Get remote url
|
||||||
|
FOR /F "tokens=2 delims=@" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO (
|
||||||
|
set commitURL=%%i
|
||||||
|
)
|
||||||
|
:: Get commit id
|
||||||
|
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --verify HEAD"') DO (
|
||||||
|
set shafull=%%i
|
||||||
|
set commitSHA=!shafull:~0,+7!
|
||||||
|
)
|
||||||
|
|
||||||
|
IF [!commitURL!] == [] (
|
||||||
|
|
||||||
|
FOR /F "tokens=1" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO (
|
||||||
|
set commitURL=%%i
|
||||||
|
)
|
||||||
|
|
||||||
|
:: strip .git
|
||||||
|
if "x!commitURL:~-4!"=="x.git" (
|
||||||
|
set commitURL=!commitURL:~0,-4!
|
||||||
|
)
|
||||||
|
|
||||||
|
:: append extra string
|
||||||
|
If NOT "%commitURL%"=="%commitURL:bitbucket.org=%" (
|
||||||
|
set commitURL=!commitURL!/commit/
|
||||||
|
) ELSE (
|
||||||
|
set commitURL=!commitURL!/commits/
|
||||||
|
)
|
||||||
|
|
||||||
|
) ELSE (
|
||||||
|
:: strip .git
|
||||||
|
if "x!commitURL:~-4!"=="x.git" (
|
||||||
|
set commitURL=!commitURL:~0,-4!
|
||||||
|
)
|
||||||
|
:: replace : to /
|
||||||
|
set commitURL=!commitURL::=/!
|
||||||
|
|
||||||
|
:: append extra string
|
||||||
|
If NOT "%commitURL%"=="%commitURL:bitbucket.org=%" (
|
||||||
|
set commitURL=https://!commitURL!/commit/
|
||||||
|
) ELSE (
|
||||||
|
set commitURL=https://!commitURL!/commits/
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
::
|
::
|
||||||
:: Detect local modifications
|
:: Detect local modifications
|
||||||
::
|
::
|
||||||
SET localChanged=0
|
set localChanged=0
|
||||||
IF NOT %errlvl% == "1" (
|
IF NOT %errlvl% == "1" (
|
||||||
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." ls-files -m"') DO (
|
FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." ls-files -m"') DO (
|
||||||
SET localChanged=1
|
set localChanged=1
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
IF [%localChanged%]==[1] (
|
IF [%localChanged%]==[1] (
|
||||||
IF NOT [%version_specialversion%] == [] (
|
set version_modifed=+m
|
||||||
set version_specialbuild=%version_specialversion%
|
|
||||||
) ELSE (
|
|
||||||
set version_specialbuild=m
|
|
||||||
)
|
|
||||||
) ELSE (
|
|
||||||
set version_specialbuild=
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
::
|
||||||
|
:: Update reapi_version.inc
|
||||||
|
::
|
||||||
|
echo #if defined _reapi_version_included>"%srcdir%\reapi_version.inc"
|
||||||
|
echo #endinput>>"%srcdir%\reapi_version.inc"
|
||||||
|
echo #endif>>"%srcdir%\reapi_version.inc"
|
||||||
|
echo #define _reapi_version_included>>"%srcdir%\reapi_version.inc"
|
||||||
|
|
||||||
|
echo.>>"%srcdir%\reapi_version.inc"
|
||||||
|
>>"%srcdir%\reapi_version.inc" echo // reapi version
|
||||||
|
>>"%srcdir%\reapi_version.inc" echo #define REAPI_VERSION %version_major%%version_minor%%commitCount%
|
||||||
|
>>"%srcdir%\reapi_version.inc" echo #define REAPI_VERSION_MAJOR %version_major%
|
||||||
|
>>"%srcdir%\reapi_version.inc" echo #define REAPI_VERSION_MINOR %version_minor%
|
||||||
|
|
||||||
|
::
|
||||||
|
:: Now form full version string like 1.0.0.1
|
||||||
|
::
|
||||||
|
|
||||||
|
set new_version=%version_major%.%version_minor%.%version_maintenance%.%commitCount%-dev%version_modifed%
|
||||||
|
|
||||||
::
|
::
|
||||||
:: Update appversion.h if version has changed or modifications/mixed revisions detected
|
:: Update appversion.h if version has changed or modifications/mixed revisions detected
|
||||||
::
|
::
|
||||||
IF NOT "%new_version%"=="%old_version%" goto _update
|
IF NOT "%new_version%"=="%old_version%" (
|
||||||
IF NOT "%version_specialbuild%"==%old_specialbuild% goto _update
|
goto _update
|
||||||
|
)
|
||||||
|
|
||||||
goto _exit
|
goto _exit
|
||||||
|
|
||||||
:_update
|
:_update
|
||||||
echo Updating appversion.h, new version is "%new_version%", the old one was "%old_version%"
|
echo Updating appversion.h and reapi_version.inc, new version is "%new_version%", the old one was %old_version%
|
||||||
echo new special build is "%version_specialbuild%", the old one was %old_specialbuild%
|
|
||||||
|
|
||||||
echo #ifndef __APPVERSION_H__>"%srcdir%\appversion.h"
|
echo #ifndef __APPVERSION_H__>"%srcdir%\appversion.h"
|
||||||
echo #define __APPVERSION_H__>>"%srcdir%\appversion.h"
|
echo #define __APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||||
@ -122,38 +205,19 @@ echo // Don't edit it.>>"%srcdir%\appversion.h"
|
|||||||
echo // >>"%srcdir%\appversion.h"
|
echo // >>"%srcdir%\appversion.h"
|
||||||
echo.>>"%srcdir%\appversion.h"
|
echo.>>"%srcdir%\appversion.h"
|
||||||
echo // Version defines>>"%srcdir%\appversion.h"
|
echo // Version defines>>"%srcdir%\appversion.h"
|
||||||
|
echo #define APP_VERSION "%new_version%">>"%srcdir%\appversion.h"
|
||||||
|
|
||||||
IF "%version_specialversion%" == "" (
|
>>"%srcdir%\appversion.h" echo #define APP_VERSION_C %version_major%,%version_minor%,%version_maintenance%,%commitCount%
|
||||||
echo #define APP_VERSION_D %version_major%.%version_minor%.%version_revision% >>"%srcdir%\appversion.h"
|
echo #define APP_VERSION_STRD "%version_major%.%version_minor%.%version_maintenance%.%commitCount%">>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_STRD "%version_major%.%version_minor%.%version_revision%">>"%srcdir%\appversion.h"
|
echo #define APP_VERSION_FLAGS 0x0L>>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_STRD_RC "%version_major%.%version_minor%.%version_revision%">>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_C %version_major%,%version_minor%,0,%version_revision% >>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_STRCS "%version_major%, %version_minor%, 0, %version_revision%">>"%srcdir%\appversion.h"
|
|
||||||
) ELSE (
|
|
||||||
echo #define APP_VERSION_D %version_major%.%version_minor%.%version_maintenance%.%version_revision% >>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_STRD "%version_major%.%version_minor%.%version_maintenance%.%version_revision%">>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_STRD_RC "%version_major%.%version_minor%.%version_maintenance%.%version_revision%">>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_C %version_major%,%version_minor%,%version_maintenance%,%version_revision% >>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_STRCS "%version_major%, %version_minor%, %version_maintenance%, %version_revision%">>"%srcdir%\appversion.h"
|
|
||||||
)
|
|
||||||
|
|
||||||
echo.>>"%srcdir%\appversion.h"
|
echo.>>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_DATE %version_date%>>"%srcdir%\appversion.h"
|
echo #define APP_COMMIT_DATE "%YYYY%-%DD%-%MM%">>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_DATE_STR "%version_date%">>"%srcdir%\appversion.h"
|
echo #define APP_COMMIT_TIME "%hour%:%min%:%sec%">>"%srcdir%\appversion.h"
|
||||||
echo.>>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_PDATE_STR "%version_pdate%">>"%srcdir%\appversion.h"
|
|
||||||
echo.>>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION_YMD_STR "%version_pdate_1%">>"%srcdir%\appversion.h"
|
|
||||||
echo.>>"%srcdir%\appversion.h"
|
|
||||||
|
|
||||||
IF NOT "%version_specialbuild%" == "" (
|
echo.>>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_FLAGS VS_FF_SPECIALBUILD>>"%srcdir%\appversion.h"
|
echo #define APP_COMMIT_SHA "%commitSHA%">>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION_SPECIALBUILD "%version_specialbuild%">>"%srcdir%\appversion.h"
|
echo #define APP_COMMIT_URL "%commitURL%">>"%srcdir%\appversion.h"
|
||||||
echo #define APP_VERSION APP_VERSION_STRD "" APP_VERSION_SPECIALBUILD>>"%srcdir%\appversion.h"
|
|
||||||
) ELSE (
|
|
||||||
echo #define APP_VERSION_FLAGS 0x0L>>"%srcdir%\appversion.h"
|
|
||||||
echo #define APP_VERSION APP_VERSION_STRD>>"%srcdir%\appversion.h"
|
|
||||||
)
|
|
||||||
echo.>>"%srcdir%\appversion.h"
|
echo.>>"%srcdir%\appversion.h"
|
||||||
|
|
||||||
echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h"
|
echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h"
|
||||||
@ -163,6 +227,7 @@ echo.>>"%srcdir%\appversion.h"
|
|||||||
:: Do update of version.cpp file last modify time to force it recompile
|
:: Do update of version.cpp file last modify time to force it recompile
|
||||||
::
|
::
|
||||||
copy /b "%srcdir%\version.cpp"+,, "%srcdir%\version.cpp"
|
copy /b "%srcdir%\version.cpp"+,, "%srcdir%\version.cpp"
|
||||||
|
endlocal
|
||||||
|
|
||||||
:_exit
|
:_exit
|
||||||
exit /B 0
|
exit /B 0
|
@ -74,12 +74,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", ""
|
VALUE "CompanyName", ""
|
||||||
VALUE "FileDescription", "AMX Mod X module, using API regamedll & rehlds"
|
VALUE "FileDescription", "AMX Mod X module, using API regamedll & rehlds"
|
||||||
VALUE "FileVersion", APP_VERSION_STRD_RC
|
VALUE "FileVersion", APP_VERSION_STRD
|
||||||
VALUE "InternalName", "Reapi"
|
VALUE "InternalName", "Reapi"
|
||||||
VALUE "LegalCopyright", ""
|
VALUE "LegalCopyright", ""
|
||||||
VALUE "OriginalFilename", "reapi_amxx.dll"
|
VALUE "OriginalFilename", "reapi_amxx.dll"
|
||||||
VALUE "ProductName", "Reapi"
|
VALUE "ProductName", "Reapi"
|
||||||
VALUE "ProductVersion", APP_VERSION_STRD_RC
|
VALUE "ProductVersion", APP_VERSION_STRD
|
||||||
#if APP_VERSION_FLAGS != 0x0L
|
#if APP_VERSION_FLAGS != 0x0L
|
||||||
VALUE "SpecialBuild", APP_VERSION_SPECIALBUILD
|
VALUE "SpecialBuild", APP_VERSION_SPECIALBUILD
|
||||||
#endif
|
#endif
|
||||||
|
@ -216,6 +216,7 @@
|
|||||||
<ClInclude Include="..\src\precompiled.h" />
|
<ClInclude Include="..\src\precompiled.h" />
|
||||||
<ClInclude Include="..\src\reapi_utils.h" />
|
<ClInclude Include="..\src\reapi_utils.h" />
|
||||||
<ClInclude Include="..\src\type_conversion.h" />
|
<ClInclude Include="..\src\type_conversion.h" />
|
||||||
|
<ClInclude Include="..\version\appversion.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\include\cssdk\common\parsemsg.cpp">
|
<ClCompile Include="..\include\cssdk\common\parsemsg.cpp">
|
||||||
@ -259,6 +260,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\src\reapi_utils.cpp" />
|
<ClCompile Include="..\src\reapi_utils.cpp" />
|
||||||
<ClCompile Include="..\src\sdk_util.cpp" />
|
<ClCompile Include="..\src\sdk_util.cpp" />
|
||||||
|
<ClCompile Include="..\version\version.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="reapi.rc" />
|
<ResourceCompile Include="reapi.rc" />
|
||||||
@ -272,7 +274,7 @@
|
|||||||
<None Include="..\extra\amxmodx\scripting\include\reapi_gamedll_const.inc" />
|
<None Include="..\extra\amxmodx\scripting\include\reapi_gamedll_const.inc" />
|
||||||
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc" />
|
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc" />
|
||||||
<None Include="..\extra\amxmodx\scripting\reapi_test.sma" />
|
<None Include="..\extra\amxmodx\scripting\reapi_test.sma" />
|
||||||
<None Include="..\src\reapi_version.inc" />
|
<None Include="..\version\reapi_version.inc" />
|
||||||
<None Include="reapi.def" />
|
<None Include="reapi.def" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
|
@ -55,6 +55,9 @@
|
|||||||
<Filter Include="src\mods">
|
<Filter Include="src\mods">
|
||||||
<UniqueIdentifier>{669b4426-091f-4cac-9281-f5585a2922fb}</UniqueIdentifier>
|
<UniqueIdentifier>{669b4426-091f-4cac-9281-f5585a2922fb}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="version">
|
||||||
|
<UniqueIdentifier>{60b1b924-8415-4c1d-9fef-57e717e12f42}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\include\metamod\dllapi.h">
|
<ClInclude Include="..\include\metamod\dllapi.h">
|
||||||
@ -660,6 +663,9 @@
|
|||||||
<ClInclude Include="..\src\type_conversion.h">
|
<ClInclude Include="..\src\type_conversion.h">
|
||||||
<Filter>src</Filter>
|
<Filter>src</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\version\appversion.h">
|
||||||
|
<Filter>version</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\include\cssdk\common\parsemsg.cpp">
|
<ClCompile Include="..\include\cssdk\common\parsemsg.cpp">
|
||||||
@ -740,6 +746,9 @@
|
|||||||
<ClCompile Include="..\src\natives\natives_addons.cpp">
|
<ClCompile Include="..\src\natives\natives_addons.cpp">
|
||||||
<Filter>src\natives</Filter>
|
<Filter>src\natives</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\version\version.cpp">
|
||||||
|
<Filter>version</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\extra\amxmodx\scripting\include\reapi.inc">
|
<None Include="..\extra\amxmodx\scripting\include\reapi.inc">
|
||||||
@ -764,12 +773,12 @@
|
|||||||
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc">
|
<None Include="..\extra\amxmodx\scripting\include\reapi_addons.inc">
|
||||||
<Filter>amxmodx\scripting\include</Filter>
|
<Filter>amxmodx\scripting\include</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="..\src\reapi_version.inc">
|
|
||||||
<Filter>src</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="..\extra\amxmodx\scripting\include\cssdk_const.inc">
|
<None Include="..\extra\amxmodx\scripting\include\cssdk_const.inc">
|
||||||
<Filter>amxmodx\scripting\include</Filter>
|
<Filter>amxmodx\scripting\include</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="..\version\reapi_version.inc">
|
||||||
|
<Filter>version</Filter>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="reapi.rc" />
|
<ResourceCompile Include="reapi.rc" />
|
||||||
|
@ -10,8 +10,8 @@ plugin_info_t Plugin_info =
|
|||||||
{
|
{
|
||||||
META_INTERFACE_VERSION, // ifvers
|
META_INTERFACE_VERSION, // ifvers
|
||||||
"ReAPI", // name
|
"ReAPI", // name
|
||||||
APP_VERSION_STRD, // version
|
APP_VERSION, // version
|
||||||
APP_VERSION_YMD_STR, // date
|
APP_COMMIT_DATE, // date
|
||||||
"Asmodai & s1lent", // author
|
"Asmodai & s1lent", // author
|
||||||
"https://github.com/s1lentq/reapi/", // url
|
"https://github.com/s1lentq/reapi/", // url
|
||||||
"ReAPI", // logtag, all caps please
|
"ReAPI", // logtag, all caps please
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#if defined _reapi_version_included
|
|
||||||
#endinput
|
|
||||||
#endif
|
|
||||||
#define _reapi_version_included
|
|
||||||
|
|
||||||
// reapi version
|
|
||||||
#define REAPI_VERSION_MAJOR 5
|
|
||||||
#define REAPI_VERSION_MINOR 0
|
|
@ -7,21 +7,15 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Version defines
|
// Version defines
|
||||||
\#define VERSION_MAJOR ${verInfo.majorVersion}
|
\#define APP_VERSION "$verInfo.asMavenVersion()"
|
||||||
\#define VERSION_MINOR ${verInfo.minorVersion}
|
\#define APP_VERSION_C $verInfo.asMavenVersionC()
|
||||||
|
\#define APP_VERSION_STRD "$verInfo.asMavenVersion(false)"
|
||||||
|
\#define APP_VERSION_FLAGS 0x0L
|
||||||
|
|
||||||
\#define APP_VERSION_D ${verInfo.format('.', '-', true)}
|
\#define APP_COMMIT_DATE "$verInfo.asCommitDate("yyyy-MM-dd")"
|
||||||
\#define APP_VERSION_C ${verInfo.majorVersion},${verInfo.minorVersion},0,${verInfo.countCommit}
|
\#define APP_COMMIT_TIME "$verInfo.asCommitTime()"
|
||||||
|
|
||||||
\#define APP_VERSION_STRD "${verInfo.majorVersion}.${verInfo.minorVersion}.${verInfo.countCommit}${formatSpecialVersion}"
|
\#define APP_COMMIT_SHA "$verInfo.commitSHA"
|
||||||
\#define APP_VERSION_STRD_RC "${verInfo.majorVersion}.${verInfo.minorVersion}.${verInfo.countCommit}${formatSpecialVersion}"
|
\#define APP_COMMIT_URL "$verInfo.commitURL"
|
||||||
|
|
||||||
\#define APP_VERSION_FLAGS ${appFlags}
|
|
||||||
\#define APP_VERSION_SPECIALBUILD "${verInfo.specialVersion}"
|
|
||||||
|
|
||||||
#set ( $commitYMD = $_DateTimeFormat.forPattern('yyyy-MM-dd').print($verInfo.lastCommitDate) )
|
|
||||||
|
|
||||||
\#define APP_VERSION_YMD_STR "${commitYMD}"
|
|
||||||
\#define APP_VERSION APP_VERSION_STRD
|
|
||||||
|
|
||||||
#endif //__APPVERSION_H__
|
#endif //__APPVERSION_H__
|
||||||
|
9
reapi/version/reapi_version.vm
Normal file
9
reapi/version/reapi_version.vm
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
\#if defined _reapi_version_included
|
||||||
|
#endinput
|
||||||
|
#endif
|
||||||
|
\#define _reapi_version_included
|
||||||
|
|
||||||
|
// reapi version
|
||||||
|
\#define REAPI_VERSION $verInfo.asReapiVersion()
|
||||||
|
\#define REAPI_VERSION_MAJOR ${verInfo.majorVersion}
|
||||||
|
\#define REAPI_VERSION_MINOR ${verInfo.minorVersion}
|
Loading…
x
Reference in New Issue
Block a user