|
@@ -283,7 +283,7 @@ end
|
|
|
# Usage: NOT intended to be used manually
|
|
# Usage: NOT intended to be used manually
|
|
|
desc 'Configure, build, and test Urho3D project'
|
|
desc 'Configure, build, and test Urho3D project'
|
|
|
task :ci do
|
|
task :ci do
|
|
|
- $start_time = Time.now - ENV['ELAPSED'].to_i + 30 if ENV['ELAPSED'] # Plus 30 seconds for rounding up to the next nearest minute
|
|
|
|
|
|
|
+ $start_time = Time.now - ENV['ELAPSED'].to_i - 30 if ENV['ELAPSED'] # Adjustment for rounding up to the next nearest minute
|
|
|
# Skip if only performing CI for selected branches and the current branch is not in the list
|
|
# Skip if only performing CI for selected branches and the current branch is not in the list
|
|
|
unless ENV['RELEASE_TAG']
|
|
unless ENV['RELEASE_TAG']
|
|
|
matched = /\[ci only:(.*?)\]/.match(ENV['COMMIT_MESSAGE'])
|
|
matched = /\[ci only:(.*?)\]/.match(ENV['COMMIT_MESSAGE'])
|
|
@@ -406,55 +406,61 @@ task :ci_teardown_cache do
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
# Usage: NOT intended to be used manually
|
|
# Usage: NOT intended to be used manually
|
|
|
-desc 'Update site documentation to GitHub Pages'
|
|
|
|
|
|
|
+desc 'Update site on GitHub Pages'
|
|
|
task :ci_site_update do
|
|
task :ci_site_update do
|
|
|
# Skip when :ci rake task was skipped
|
|
# Skip when :ci rake task was skipped
|
|
|
next unless File.exist?('../Build/CMakeCache.txt')
|
|
next unless File.exist?('../Build/CMakeCache.txt')
|
|
|
- $start_time = Time.now - ENV['ELAPSED'].to_i + 30 if ENV['ELAPSED'] # Plus 30 seconds for rounding up to the next nearest minute
|
|
|
|
|
|
|
+ $start_time = Time.now - ENV['ELAPSED'].to_i - 30 if ENV['ELAPSED'] # Adjustment for rounding up to the next nearest minute
|
|
|
next if timeup
|
|
next if timeup
|
|
|
- puts "Updating site...\n\n"; $stdout.flush
|
|
|
|
|
- # Pull or clone
|
|
|
|
|
- system 'cd ../doc-Build 2>/dev/null && git pull -q -r || git clone --depth 1 -q https://github.com/urho3d/urho3d.github.io.git ../doc-Build' or abort 'Failed to pull/clone'
|
|
|
|
|
|
|
+ puts "Updating site..."; $stdout.flush
|
|
|
|
|
+ system 'git clone --depth 1 -q https://github.com/urho3d/urho3d.github.io.git ../urho3d.github.io' or abort 'Failed to clone urho3d/urho3d.github.io'
|
|
|
# Update credits from README.md to about.yml
|
|
# Update credits from README.md to about.yml
|
|
|
- system "ruby -lne 'BEGIN { credits = false }; puts $_ if credits; credits = true if /bugfixes by:/; credits = false if /^$/' README.md |ruby -i -le 'credits = STDIN.read; puts ARGF.read.gsub(/(?<=contributors:\n).*?\n\n/m, credits)' ../doc-Build/_data/about.yml" or abort 'Failed to update credits'
|
|
|
|
|
|
|
+ system "ruby -lne 'BEGIN { credits = false }; puts $_ if credits; credits = true if /bugfixes by:/; credits = false if /^$/' README.md |ruby -i -le 'credits = STDIN.read; puts ARGF.read.gsub(/(?<=contributors:\n).*?\n\n/m, credits)' ../urho3d.github.io/_data/about.yml" or abort 'Failed to update credits'
|
|
|
# Setup doxygen to use minimal theme
|
|
# Setup doxygen to use minimal theme
|
|
|
system "ruby -i -pe 'BEGIN { a = {%q{HTML_HEADER} => %q{minimal-header.html}, %q{HTML_FOOTER} => %q{minimal-footer.html}, %q{HTML_STYLESHEET} => %q{minimal-doxygen.css}, %q{HTML_COLORSTYLE_HUE} => 200, %q{HTML_COLORSTYLE_SAT} => 0, %q{HTML_COLORSTYLE_GAMMA} => 20, %q{DOT_IMAGE_FORMAT} => %q{svg}, %q{INTERACTIVE_SVG} => %q{YES}, %q{COLS_IN_ALPHA_INDEX} => 3} }; a.each {|k, v| gsub(/\#{k}\s*?=.*?\n/, %Q{\#{k} = \#{v}\n}) }' ../Build/Docs/generated/Doxyfile" or abort 'Failed to setup doxygen configuration file'
|
|
system "ruby -i -pe 'BEGIN { a = {%q{HTML_HEADER} => %q{minimal-header.html}, %q{HTML_FOOTER} => %q{minimal-footer.html}, %q{HTML_STYLESHEET} => %q{minimal-doxygen.css}, %q{HTML_COLORSTYLE_HUE} => 200, %q{HTML_COLORSTYLE_SAT} => 0, %q{HTML_COLORSTYLE_GAMMA} => 20, %q{DOT_IMAGE_FORMAT} => %q{svg}, %q{INTERACTIVE_SVG} => %q{YES}, %q{COLS_IN_ALPHA_INDEX} => 3} }; a.each {|k, v| gsub(/\#{k}\s*?=.*?\n/, %Q{\#{k} = \#{v}\n}) }' ../Build/Docs/generated/Doxyfile" or abort 'Failed to setup doxygen configuration file'
|
|
|
- system 'cp ../doc-Build/_includes/Doxygen/minimal-* ../Build/Docs' or abort 'Failed to copy minimal-themed template'
|
|
|
|
|
|
|
+ system 'cp ../urho3d.github.io/_includes/Doxygen/minimal-* ../Build/Docs' or abort 'Failed to copy minimal-themed template'
|
|
|
release = ENV['RELEASE_TAG'] || 'HEAD'
|
|
release = ENV['RELEASE_TAG'] || 'HEAD'
|
|
|
unless release == 'HEAD'
|
|
unless release == 'HEAD'
|
|
|
- system "mkdir -p ../doc-Build/documentation/#{release}" or abort 'Failed to create directory for new document version'
|
|
|
|
|
|
|
+ system "mkdir -p ../urho3d.github.io/documentation/#{release}" or abort 'Failed to create directory for new document version'
|
|
|
system "ruby -i -pe 'gsub(/HEAD/, %q{#{release}})' ../Build/Docs/minimal-header.html" or abort 'Failed to update document version in YAML Front Matter block'
|
|
system "ruby -i -pe 'gsub(/HEAD/, %q{#{release}})' ../Build/Docs/minimal-header.html" or abort 'Failed to update document version in YAML Front Matter block'
|
|
|
append_new_release release or abort 'Failed to add new release to document data file'
|
|
append_new_release release or abort 'Failed to add new release to document data file'
|
|
|
end
|
|
end
|
|
|
# Generate and sync doxygen pages
|
|
# Generate and sync doxygen pages
|
|
|
- system "cd ../Build && make -j$numjobs doc >/dev/null 2>&1 && ruby -i -pe 'gsub(/(<\\/?h)3([^>]*?>)/, %q{\\14\\2}); gsub(/(<\\/?h)2([^>]*?>)/, %q{\\13\\2}); gsub(/(<\\/?h)1([^>]*?>)/, %q{\\12\\2})' Docs/html/_*.html && rsync -a --delete Docs/html/ ../doc-Build/documentation/#{release}" or abort 'Failed to generate/rsync doxygen pages'
|
|
|
|
|
- # Supply GIT credentials and push site documentation to urho3d/urho3d.github.io.git
|
|
|
|
|
- system "cd ../doc-Build && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && if git commit -qm \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\"; then git push -q >/dev/null 2>&1; fi" or abort 'Failed to update site'
|
|
|
|
|
- # Skip detecting API documentation changes when HEAD has moved or it is too late already as a release tag has just been pushed
|
|
|
|
|
|
|
+ system "cd ../Build && make -j$numjobs doc >/dev/null 2>&1 && ruby -i -pe 'gsub(/(<\\/?h)3([^>]*?>)/, %q{\\14\\2}); gsub(/(<\\/?h)2([^>]*?>)/, %q{\\13\\2}); gsub(/(<\\/?h)1([^>]*?>)/, %q{\\12\\2})' Docs/html/_*.html && rsync -a --delete Docs/html/ ../urho3d.github.io/documentation/#{release}" or abort 'Failed to generate/rsync doxygen pages'
|
|
|
|
|
+ # Supply GIT credentials to push site documentation changes to urho3d/urho3d.github.io.git
|
|
|
|
|
+ system "cd ../urho3d.github.io && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && if git commit -qm \"Travis CI: site documentation update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\"; then git push -q >/dev/null 2>&1; fi" or abort 'Failed to update site'
|
|
|
|
|
+ next if timeup
|
|
|
|
|
+ # Skip detecting source tree changes when HEAD has moved or it is too late already as a release tag has just been pushed
|
|
|
unless ENV['RELEASE_TAG'] || `git fetch -qf origin #{ENV['TRAVIS_BRANCH']}; git log -1 --pretty=format:'%H' FETCH_HEAD` != ENV['TRAVIS_COMMIT']
|
|
unless ENV['RELEASE_TAG'] || `git fetch -qf origin #{ENV['TRAVIS_BRANCH']}; git log -1 --pretty=format:'%H' FETCH_HEAD` != ENV['TRAVIS_COMMIT']
|
|
|
- if system("git add Docs/*API* && git commit -qm 'Test commit to detect API changes' >/dev/null 2>&1") # Use extra quiet mode as there could be no changes at all
|
|
|
|
|
- puts "Updating API documentation...\n\n"
|
|
|
|
|
|
|
+ puts "Updating source tree..."
|
|
|
|
|
+ # Supply GIT credentials to push source tree changes to urho3d/Urho3D.git
|
|
|
|
|
+ system 'git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/$TRAVIS_REPO_SLUG.git'
|
|
|
|
|
+ system "git add Source && git commit -qm 'Travis CI: source tree update at #{Time.now.utc}.' >/dev/null 2>&1" # Use extra quiet mode as there could be no changes at all
|
|
|
|
|
+ if /2008-([0-9]{4}) the Urho3D project/.match(File.read('Rakefile'))[1].to_i != Time.now.year
|
|
|
|
|
+ # Automatically bump copyright when crossing a new year and give instruction to clear the cache if so since the cache is of no use anyway because of massive changes
|
|
|
|
|
+ system "git add #{bump_copyright_year.join ' '} && if git commit -qm 'Travis CI: bump copyright to #{Time.now.year}.\n[ccache clear]'; then git push origin HEAD:#{ENV['TRAVIS_BRANCH']} -q >/dev/null 2>&1; fi" or abort "Failed to push copyright update for #{ENV['TRAVIS_BRANCH']}"
|
|
|
|
|
+ ['urho3d.github.io master', 'android-ndk ndk-update-trigger', 'rpi-sysroot sysroot-update-trigger', 'emscripten-sdk sdk-update-trigger'].each { |var| pair = var.split; system "if [ ! -d ../#{pair.first} ]; then git clone -q --depth 1 --branch #{pair.last} https://github.com/urho3d/#{pair.first} ../#{pair.first}; fi" or abort "Failed to clone urho3d/#{pair.first}"; system "cd ../#{pair.first} && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/#{pair.first} && git add #{bump_copyright_year("../#{pair.first}").join ' '} && if git commit -qm 'Travis CI: bump copyright to #{Time.now.year}.'; then git push -q >/dev/null 2>&1; fi" or abort "Failed to push copyright update for urho3d/#{pair.first}"; }
|
|
|
|
|
+ elsif system("git add Docs/*API* && git commit -qm 'Test commit to detect API documentation changes' >/dev/null 2>&1")
|
|
|
# Automatically give instruction to do packaging when API has changed, unless the instruction is already given in this commit
|
|
# Automatically give instruction to do packaging when API has changed, unless the instruction is already given in this commit
|
|
|
bump_soversion 'Source/Urho3D/.soversion' or abort 'Failed to bump soversion'
|
|
bump_soversion 'Source/Urho3D/.soversion' or abort 'Failed to bump soversion'
|
|
|
- system "git add Source/Urho3D/.soversion && git commit --amend -qm \"Travis CI: API documentation update at #{Time.now.utc}.\n#{ENV['PACKAGE_UPLOAD'] ? '' : '[ci package]'}\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\"" or abort 'Failed to commit API documentation' # Pending push
|
|
|
|
|
|
|
+ system "git add Source/Urho3D/.soversion && git commit --amend -qm \"Travis CI: API documentation update at #{Time.now.utc}.\n#{ENV['PACKAGE_UPLOAD'] ? '' : '[ci package]'}\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT\n\nMessage: $COMMIT_MESSAGE\"" or abort 'Failed to commit API documentation'
|
|
|
end
|
|
end
|
|
|
|
|
+ else
|
|
|
|
|
+ puts 'Skipped detecting source tree changes due to moving HEAD' unless ENV['RELEASE_TAG']
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
# Usage: NOT intended to be used manually
|
|
# Usage: NOT intended to be used manually
|
|
|
desc 'Update web samples to GitHub Pages'
|
|
desc 'Update web samples to GitHub Pages'
|
|
|
task :ci_emscripten_samples_update do
|
|
task :ci_emscripten_samples_update do
|
|
|
- $start_time = Time.now - ENV['ELAPSED'].to_i + 30 if ENV['ELAPSED'] # Plus 30 seconds for rounding up to the next nearest minute
|
|
|
|
|
|
|
+ $start_time = Time.now - ENV['ELAPSED'].to_i - 30 if ENV['ELAPSED'] # Adjustment for rounding up to the next nearest minute
|
|
|
next if timeup
|
|
next if timeup
|
|
|
puts '"Updating Web samples in main website...'
|
|
puts '"Updating Web samples in main website...'
|
|
|
- # Pull or clone
|
|
|
|
|
- system 'cd ../doc-Build 2>/dev/null && git pull -q -r || git clone --depth 1 -q https://github.com/urho3d/urho3d.github.io.git ../doc-Build' or abort 'Failed to pull/clone'
|
|
|
|
|
- # Sync Web samples
|
|
|
|
|
- system "rsync -a --delete --exclude tool --exclude *.pak ../Build/bin/ ../doc-Build/samples" or abort 'Failed to rsync Web samples'
|
|
|
|
|
- # Update Web json data file
|
|
|
|
|
|
|
+ system 'git clone --depth 1 -q https://github.com/urho3d/urho3d.github.io.git ../urho3d.github.io' or abort 'Failed to clone urho3d/urho3d.github.io'
|
|
|
|
|
+ system "rsync -a --delete --exclude tool --exclude *.pak ../Build/bin/ ../urho3d.github.io/samples" or abort 'Failed to rsync Web samples'
|
|
|
update_web_samples_data or abort 'Failed to update Web json data file'
|
|
update_web_samples_data or abort 'Failed to update Web json data file'
|
|
|
root_commit, _ = get_root_commit_and_recipients
|
|
root_commit, _ = get_root_commit_and_recipients
|
|
|
- system "cd ../doc-Build && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && ( git commit -qm \"Travis CI: Web samples update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/#{root_commit}\n\nMessage: #{`git log --format=%B -n 1 #{root_commit}`}\" || true) && git push -q >/dev/null 2>&1" or abort 'Failed to update Web samples'
|
|
|
|
|
|
|
+ system "cd ../urho3d.github.io && git config user.name $GIT_NAME && git config user.email $GIT_EMAIL && git remote set-url --push origin https://[email protected]/urho3d/urho3d.github.io.git && git add -A . && ( git commit -qm \"Travis CI: Web samples update at #{Time.now.utc}.\n\nCommit: https://github.com/$TRAVIS_REPO_SLUG/commit/#{root_commit}\n\nMessage: #{`git log --format=%B -n 1 #{root_commit}`}\" || true) && git push -q >/dev/null 2>&1" or abort 'Failed to update Web samples'
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
# Usage: NOT intended to be used manually
|
|
# Usage: NOT intended to be used manually
|
|
@@ -489,7 +495,7 @@ task :ci_create_mirrors do
|
|
|
stream = YAML::load_stream(File.open('.travis.yml'))
|
|
stream = YAML::load_stream(File.open('.travis.yml'))
|
|
|
notifications = stream[0]['notifications']
|
|
notifications = stream[0]['notifications']
|
|
|
notifications['email']['recipients'] = get_root_commit_and_recipients().last unless notifications['email']['recipients']
|
|
notifications['email']['recipients'] = get_root_commit_and_recipients().last unless notifications['email']['recipients']
|
|
|
- stream.drop(1).each { |doc| branch = doc.delete('branch'); ci = branch['name']; ci_branch = ENV['RELEASE_TAG'] || (ENV['TRAVIS_BRANCH'] == 'master' && ENV['TRAVIS_PULL_REQUEST'] == 'false') ? ci : (ENV['TRAVIS_PULL_REQUEST'] == 'false' ? "#{ENV['TRAVIS_BRANCH']}-#{ci}" : "PR ##{ENV['TRAVIS_PULL_REQUEST']}-#{ci}"); unless (branch['mandatory'] || !head_moved) && ((ci_only && ci_only.map { |i| /#{i}/ =~ ci }.any?) || (!ci_only && (branch['active'] || (scan && /Scan/ =~ ci) || (annotate && /Annotate/ =~ ci)))); system "if git fetch origin #{ci_branch}:#{ci_branch} 2>/dev/null; then git push -qf origin --delete #{ci_branch}; fi"; puts "Skipped creating #{ci_branch} mirror branch due to moving HEAD" if branch['active'] && head_moved; next; end; lastjob = doc['matrix'] && doc['matrix']['include'] ? doc['matrix']['include'].length : (doc['env']['matrix'] ? doc['env']['matrix'].length : 1); doc['after_script'] = [*doc['after_script']] << (lastjob == 1 ? '%s' : "if [ ${TRAVIS_JOB_NUMBER##*.} == #{lastjob} ]; then %s; fi") % 'rake ci_delete_mirror'; doc['notifications'] = notifications unless doc['notifications']; File.open('.travis.yml.doc', 'w') { |file| file.write doc.to_yaml }; system "git checkout -B #{ci_branch} && rm .appveyor.yml .travis.yml && mv .travis.yml.doc .travis.yml && git add -A . && git commit -qm \"#{escaped_commit_message}\" && git push -qf -u origin #{ci_branch} >/dev/null 2>&1 && git checkout -q -" or abort "Failed to create #{ci_branch} mirror branch" }
|
|
|
|
|
|
|
+ stream.drop(1).each { |doc| branch = doc.delete('branch'); ci = branch['name']; ci_branch = ENV['RELEASE_TAG'] || (ENV['TRAVIS_BRANCH'] == 'master' && ENV['TRAVIS_PULL_REQUEST'] == 'false') ? ci : (ENV['TRAVIS_PULL_REQUEST'] == 'false' ? "#{ENV['TRAVIS_BRANCH']}-#{ci}" : "PR ##{ENV['TRAVIS_PULL_REQUEST']}-#{ci}"); unless (branch['mandatory'] || !head_moved) && ((ci_only && ci_only.map { |i| /#{i}/ =~ ci }.any?) || (!ci_only && (branch['active'] || (scan && /Scan/ =~ ci) || (annotate && /Annotate/ =~ ci)))); system "if git fetch origin #{ci_branch}:#{ci_branch} 2>/dev/null; then git push -qf origin --delete #{ci_branch}; fi"; puts "Skipped creating #{ci_branch} mirror branch due to moving HEAD" if !ci_only && branch['active'] && head_moved; next; end; lastjob = doc['matrix'] && doc['matrix']['include'] ? doc['matrix']['include'].length : (doc['env']['matrix'] ? doc['env']['matrix'].length : 1); doc['after_script'] = [*doc['after_script']] << (lastjob == 1 ? '%s' : "if [ ${TRAVIS_JOB_NUMBER##*.} == #{lastjob} ]; then %s; fi") % 'rake ci_delete_mirror'; doc['notifications'] = notifications unless doc['notifications']; File.open('.travis.yml.doc', 'w') { |file| file.write doc.to_yaml }; puts "Creating #{ci_branch} mirror branch..."; system "git checkout -qB #{ci_branch} && rm .appveyor.yml .travis.yml && mv .travis.yml.doc .travis.yml && git add -A . && git commit -qm \"#{escaped_commit_message}\" && git push -qf -u origin #{ci_branch} >/dev/null 2>&1 && git checkout -q -" or abort "Failed to create #{ci_branch} mirror branch" }
|
|
|
# Push pending commits if any
|
|
# Push pending commits if any
|
|
|
system "git push origin #{head}:#{ENV['TRAVIS_BRANCH']} -q >/dev/null 2>&1" or abort "Failed to push pending commits to #{ENV['TRAVIS_BRANCH']}" if head_moved
|
|
system "git push origin #{head}:#{ENV['TRAVIS_BRANCH']} -q >/dev/null 2>&1" or abort "Failed to push pending commits to #{ENV['TRAVIS_BRANCH']}" if head_moved
|
|
|
end
|
|
end
|
|
@@ -514,7 +520,7 @@ task :ci_package_upload do
|
|
|
ENV['config'] = 'Release' if ENV['XCODE']
|
|
ENV['config'] = 'Release' if ENV['XCODE']
|
|
|
# Skip when :ci rake task was skipped
|
|
# Skip when :ci rake task was skipped
|
|
|
next unless File.exist?("#{ENV['build_tree']}/CMakeCache.txt")
|
|
next unless File.exist?("#{ENV['build_tree']}/CMakeCache.txt")
|
|
|
- $start_time = Time.now - ENV['ELAPSED'].to_i + 30 if ENV['ELAPSED'] # Plus 30 seconds for rounding up to the next nearest minute
|
|
|
|
|
|
|
+ $start_time = Time.now - ENV['ELAPSED'].to_i - 30 if ENV['ELAPSED'] # Adjustment for rounding up to the next nearest minute
|
|
|
next if timeup
|
|
next if timeup
|
|
|
# Generate the documentation if necessary
|
|
# Generate the documentation if necessary
|
|
|
if ENV['SITE_UPDATE']
|
|
if ENV['SITE_UPDATE']
|
|
@@ -601,7 +607,7 @@ def timeup
|
|
|
return nil
|
|
return nil
|
|
|
end
|
|
end
|
|
|
elapsed_time = (Time.now - $start_time) / 60
|
|
elapsed_time = (Time.now - $start_time) / 60
|
|
|
- puts "\nCheckpoint reached, elapsed time: #{elapsed_time.to_i} minutes\n\n" unless $already_timeup
|
|
|
|
|
|
|
+ puts "\n=== Checkpoint reached, elapsed time: #{elapsed_time.to_i} minutes ===\n\n" unless $already_timeup
|
|
|
$stdout.flush
|
|
$stdout.flush
|
|
|
return $already_timeup = elapsed_time > 40
|
|
return $already_timeup = elapsed_time > 40
|
|
|
end
|
|
end
|
|
@@ -774,7 +780,7 @@ def wait_for_block comment = '', retries = -1, retry_interval = 60, exit_code_sy
|
|
|
return retries == 0 ? nil : (exit_code_sym ? thread[exit_code_sym] : 0)
|
|
return retries == 0 ? nil : (exit_code_sym ? thread[exit_code_sym] : 0)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-def append_new_release release, filename = '../doc-Build/_data/urho3d.json'
|
|
|
|
|
|
|
+def append_new_release release, filename = '../urho3d.github.io/_data/urho3d.json'
|
|
|
begin
|
|
begin
|
|
|
urho3d_hash = JSON.parse File.read filename
|
|
urho3d_hash = JSON.parse File.read filename
|
|
|
unless urho3d_hash['releases'].last == release
|
|
unless urho3d_hash['releases'].last == release
|
|
@@ -787,7 +793,7 @@ def append_new_release release, filename = '../doc-Build/_data/urho3d.json'
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
-def update_web_samples_data dir = '../doc-Build/samples', filename = '../doc-Build/_data/web.json'
|
|
|
|
|
|
|
+def update_web_samples_data dir = '../urho3d.github.io/samples', filename = '../urho3d.github.io/_data/web.json'
|
|
|
begin
|
|
begin
|
|
|
web = JSON.parse File.read filename
|
|
web = JSON.parse File.read filename
|
|
|
Dir.chdir(dir) { web['samples'] = Dir['*.html'].sort }
|
|
Dir.chdir(dir) { web['samples'] = Dir['*.html'].sort }
|
|
@@ -798,6 +804,21 @@ def update_web_samples_data dir = '../doc-Build/samples', filename = '../doc-Bui
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+def bump_copyright_year dir='.'
|
|
|
|
|
+ begin
|
|
|
|
|
+ copyrighted = `cd #{dir} && git grep -El '2008-[0-9]{4} the Urho3D project'`.split
|
|
|
|
|
+ Dir.chdir dir do
|
|
|
|
|
+ copyrighted.each { |filename|
|
|
|
|
|
+ replaced_content = File.read(filename).gsub(/2008-[0-9]{4} the Urho3D project/, "2008-#{Time.now.year} the Urho3D project")
|
|
|
|
|
+ File.open(filename, 'w') { |file| file.puts replaced_content }
|
|
|
|
|
+ }
|
|
|
|
|
+ end
|
|
|
|
|
+ return copyrighted
|
|
|
|
|
+ rescue
|
|
|
|
|
+ abort 'Failed to bump copyright year'
|
|
|
|
|
+ end
|
|
|
|
|
+end
|
|
|
|
|
+
|
|
|
def bump_soversion filename
|
|
def bump_soversion filename
|
|
|
begin
|
|
begin
|
|
|
version = File.read(filename).split '.'
|
|
version = File.read(filename).split '.'
|