Skip to content

Commit

Permalink
Updated build scripts to generate timestamp for distribution folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Kindborg committed Jan 27, 2016
1 parent c48a7b7 commit e51c269
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
30 changes: 13 additions & 17 deletions buildHyper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
# GLOBAL VARIABLES #
#######################################################

$VersionString = 'UndefinedVersion'

def version
$VersionString
end
# None

#######################################################
# BUILD FUNCTIONS #
Expand Down Expand Up @@ -71,7 +67,8 @@ def buildCopyHyperToDistDir

# Create package.json for this version.
content = fileReadContent(pathSourcePackageJson)
content = content.gsub("__VERSION__", version)
content = content.gsub("__VERSION__", distVersion)
content = content.gsub("__VERSION_LABEL__", distVersionLabel)
fileSaveContent(pathDistSource + "package.json", content)

# Delete hidden OS X files.
Expand All @@ -95,8 +92,8 @@ def buildDistBinaries
puts "Building Win32"
buildDistBinaryWin32

#puts "Building Win64"
#buildDistBinaryWin64
puts "Building Win64"
buildDistBinaryWin64

# Delete hidden OS X files.
fileDeleteAll(pathDist + "**/.DS_Store")
Expand Down Expand Up @@ -181,7 +178,7 @@ def buildDistBinaryMac64
info = fileReadContent(infoPlistPath)
#puts(info)
info = macPatchValue(info, "CFBundleName", applicationName)
info = macPatchValue(info, "CFBundleShortVersionString", version)
info = macPatchValue(info, "CFBundleShortVersionString", distVersion)
info = macPatchValue(info, "CFBundleVersion", distCopyright)
#puts(info)
fileSaveContent(infoPlistPath, info)
Expand Down Expand Up @@ -249,12 +246,12 @@ def buildZippedBinaries
zipPackage(distPackageMac64)
end
zipPackage(distPackageWin32)
#zipPackage(distPackageWin64)
zipPackage(distPackageWin64)
end

# Build distribution package.
def buildDist zipFlag
puts "Building " + distPackageName + " version " + version + " with node-webkit version " + nodeWebKitVersion
puts "Building " + distPackageName + " version " + distVersion + " with node-webkit version " + nodeWebKitVersion
buildCreateDistDir
buildPreProcess
buildCopyHyperToDistDir
Expand Down Expand Up @@ -345,23 +342,23 @@ def zipPackage(distPackage)
#######################################################

def distPackageLinux32
pathDist + distPackageName + "_Linux_32_" + version + "/"
pathDist + distPackageName + "_Linux_32_" + distPackageVersion + "/"
end

def distPackageLinux64
pathDist + distPackageName + "_Linux_64_" + version + "/"
pathDist + distPackageName + "_Linux_64_" + distPackageVersion + "/"
end

def distPackageMac64
pathDist + distPackageName + "_Mac_64_" + version + "/"
pathDist + distPackageName + "_Mac_64_" + distPackageVersion + "/"
end

def distPackageWin32
pathDist + distPackageName + "_Win_32_" + version + "/"
pathDist + distPackageName + "_Win_32_" + distPackageVersion + "/"
end

def distPackageWin64
pathDist + distPackageName + "_Win_64_" + version + "/"
pathDist + distPackageName + "_Win_64_" + distPackageVersion + "/"
end


Expand All @@ -374,7 +371,6 @@ def distPackageWin64
#######################################################
# START BUILD PROCESS #
#######################################################
$VersionString = distVersion

if (ARGV.size == 0)
buildDist "nozip"
Expand Down
26 changes: 25 additions & 1 deletion buildPlugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,41 @@ def distCopyright
"Copyright (c) 2015 Evothings AB"
end

# TODO: Update on new release.
def distVersion
"2.0.0"
end

# TODO: Update on new release.
def distVersionLabel
# TODO: Remove " Beta 3" for final release.
distVersion + " Beta 3"
end

# TODO: Update on new release.
def distPackageVersion
time = Time.new

timestamp =
time.year.to_s[-2..-1] +
time.month.to_s.rjust(2, '0') +
time.day.to_s.rjust(2, '0') +
"_" +
time.hour.to_s.rjust(2, '0') +
time.min.to_s.rjust(2, '0')

# TODO: Remove "_Beta3" for final release.
distVersion + "_Beta3_" + timestamp
end

def root
"../"
end

# Destination folder for distribution packages.
def pathDist
root + distPackageName + "_" + version + "/"

root + distPackageName + "_" + distPackageVersion + "/"
end

# Destination temporary folder for application code.
Expand Down
2 changes: 1 addition & 1 deletion package-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"private": true,
"window":
{
"title": "Evothings Workbench __VERSION__ Beta 3",
"title": "Evothings Workbench __VERSION_LABEL__",
"toolbar": false,
"frame": true,
"width": 700,
Expand Down

0 comments on commit e51c269

Please sign in to comment.