Added debug-release build for installers with debug console, changed Azure jobs to build them.

10.7.0-preview
mikeller 2020-03-19 23:40:29 +13:00
parent 4eda5f852f
commit 0a43465ace
3 changed files with 47 additions and 38 deletions

View File

@ -7,9 +7,10 @@
# ${VERSION} - Version to generate (x.y.z) # ${VERSION} - Version to generate (x.y.z)
# ${PLATFORM} - Platform to generate (win32 or win64) # ${PLATFORM} - Platform to generate (win32 or win64)
# ${DEST_FOLDER} - Destination folder for the installer files # ${DEST_FOLDER} - Destination folder for the installer files
# ${SOURCE_FOLDER} - Source folder for the application files
# Some definitions # Some definitions
!define SOURCE_FILES "..\..\apps\betaflight-configurator\${PLATFORM}\*" !define SOURCE_FILES "..\..\${SOURCE_FOLDER}\betaflight-configurator\${PLATFORM}\*"
!define APP_NAME "Betaflight Configurator" !define APP_NAME "Betaflight Configurator"
!define COMPANY_NAME "The Betaflight open source project." !define COMPANY_NAME "The Betaflight open source project."
!define GROUP_NAME "Betaflight" !define GROUP_NAME "Betaflight"

View File

@ -42,8 +42,8 @@ stages:
testResultsFiles: '**/test_results.xml' testResultsFiles: '**/test_results.xml'
testRunTitle: 'Windows' testRunTitle: 'Windows'
buildPlatform: 'Win32' buildPlatform: 'Win32'
- script: yarn release --win32 - script: yarn debug-release --win32
displayName: 'Run yarn release for win32' displayName: 'Run yarn debug release for win32'
- powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE - powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
displayName: 'Publish Windows release' displayName: 'Publish Windows release'
@ -64,8 +64,8 @@ stages:
displayName: 'Install Gulp' displayName: 'Install Gulp'
- script: yarn install - script: yarn install
displayName: 'Run yarn install' displayName: 'Run yarn install'
- script: yarn gulp release --osx64 - script: yarn gulp debug-release --osx64
displayName: 'Run yarn release for OSX64' displayName: 'Run yarn debug release for OSX64'
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
displayName: 'Publish MacOS release' displayName: 'Publish MacOS release'
inputs: inputs:
@ -83,8 +83,8 @@ stages:
displayName: 'Install Node.js 10.16.3' displayName: 'Install Node.js 10.16.3'
- script: yarn install - script: yarn install
displayName: 'Run yarn install' displayName: 'Run yarn install'
- script: yarn release --linux64 - script: yarn debug-release --linux64
displayName: 'Run yarn release for linux64' displayName: 'Run yarn debug release for linux64'
- script: cd $(System.DefaultWorkingDirectory)/release; find -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \; - script: cd $(System.DefaultWorkingDirectory)/release; find -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
displayName: 'Clean release folders' displayName: 'Clean release folders'
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1

View File

@ -75,19 +75,24 @@ const getChangesetId = gulp.series(getHash, writeChangesetId);
gulp.task('get-changeset-id', getChangesetId); gulp.task('get-changeset-id', getChangesetId);
// dist_yarn MUST be done after dist_src // dist_yarn MUST be done after dist_src
var distBuild = gulp.series(dist_src, dist_changelog, dist_yarn, dist_locale, dist_libraries, dist_resources, getChangesetId); const distBuild = gulp.series(dist_src, dist_changelog, dist_yarn, dist_locale, dist_libraries, dist_resources, getChangesetId);
var distRebuild = gulp.series(clean_dist, distBuild); const distRebuild = gulp.series(clean_dist, distBuild);
gulp.task('dist', distRebuild); gulp.task('dist', distRebuild);
var appsBuild = gulp.series(gulp.parallel(clean_apps, distRebuild), apps, gulp.parallel(listPostBuildTasks(APPS_DIR))); const appsBuild = gulp.series(gulp.parallel(clean_apps, distRebuild), apps, gulp.parallel(listPostBuildTasks(APPS_DIR)));
gulp.task('apps', appsBuild); gulp.task('apps', appsBuild);
var debugBuild = gulp.series(distBuild, debug, gulp.parallel(listPostBuildTasks(DEBUG_DIR)), start_debug) const debugAppsBuild = gulp.series(gulp.parallel(clean_debug, distRebuild), debug, gulp.parallel(listPostBuildTasks(DEBUG_DIR)));
const debugBuild = gulp.series(distBuild, debug, gulp.parallel(listPostBuildTasks(DEBUG_DIR)), start_debug);
gulp.task('debug', debugBuild); gulp.task('debug', debugBuild);
var releaseBuild = gulp.series(gulp.parallel(clean_release, appsBuild), gulp.parallel(listReleaseTasks())); const releaseBuild = gulp.series(gulp.parallel(clean_release, appsBuild), gulp.parallel(listReleaseTasks(APPS_DIR)));
gulp.task('release', releaseBuild); gulp.task('release', releaseBuild);
const debugReleaseBuild = gulp.series(gulp.parallel(clean_release, debugAppsBuild), gulp.parallel(listReleaseTasks(DEBUG_DIR)));
gulp.task('debug-release', debugReleaseBuild);
gulp.task('default', debugBuild); gulp.task('default', debugBuild);
// ----------------- // -----------------
@ -503,12 +508,12 @@ function start_debug(done) {
} }
// Create installer package for windows platforms // Create installer package for windows platforms
function release_win(arch, done) { function release_win(arch, appDirectory, done) {
// Check if makensis exists // Check if makensis exists
if (!commandExistsSync('makensis')) { if (!commandExistsSync('makensis')) {
console.warn('makensis command not found, not generating win package for ' + arch); console.warn('makensis command not found, not generating win package for ' + arch);
return done(); done();
} }
// The makensis does not generate the folder correctly, manually // The makensis does not generate the folder correctly, manually
@ -520,7 +525,8 @@ function release_win(arch, done) {
define: { define: {
'VERSION': pkg.version, 'VERSION': pkg.version,
'PLATFORM': arch, 'PLATFORM': arch,
'DEST_FOLDER': RELEASE_DIR 'DEST_FOLDER': RELEASE_DIR,
'SOURCE_FOLDER': appDirectory,
} }
} }
@ -534,10 +540,10 @@ function release_win(arch, done) {
} }
// Create distribution package (zip) for windows and linux platforms // Create distribution package (zip) for windows and linux platforms
function release_zip(arch) { function release_zip(arch, appDirectory) {
var src = path.join(APPS_DIR, pkg.name, arch, '**'); const src = path.join(appDirectory, pkg.name, arch, '**');
var output = getReleaseFilename(arch, 'zip'); const output = getReleaseFilename(arch, 'zip');
var base = path.join(APPS_DIR, pkg.name, arch); const base = path.join(appDirectory, pkg.name, arch);
return compressFiles(src, base, output, 'Betaflight Configurator'); return compressFiles(src, base, output, 'Betaflight Configurator');
} }
@ -561,15 +567,15 @@ function compressFiles(srcPath, basePath, outputFile, zipFolder) {
.pipe(gulp.dest(RELEASE_DIR)); .pipe(gulp.dest(RELEASE_DIR));
} }
function release_deb(arch, done) { function release_deb(arch, appDirectory, done) {
// Check if dpkg-deb exists // Check if dpkg-deb exists
if (!commandExistsSync('dpkg-deb')) { if (!commandExistsSync('dpkg-deb')) {
console.warn('dpkg-deb command not found, not generating deb package for ' + arch); console.warn('dpkg-deb command not found, not generating deb package for ' + arch);
return done(); done();
} }
return gulp.src([path.join(APPS_DIR, pkg.name, arch, '*')]) return gulp.src([path.join(appDirectory, pkg.name, arch, '*')])
.pipe(deb({ .pipe(deb({
package: pkg.name, package: pkg.name,
version: pkg.version, version: pkg.version,
@ -590,12 +596,12 @@ function release_deb(arch, done) {
})); }));
} }
function release_rpm(arch, done) { function release_rpm(arch, appDirectory, done) {
// Check if dpkg-deb exists // Check if dpkg-deb exists
if (!commandExistsSync('rpmbuild')) { if (!commandExistsSync('rpmbuild')) {
console.warn('rpmbuild command not found, not generating rpm package for ' + arch); console.warn('rpmbuild command not found, not generating rpm package for ' + arch);
return done(); done();
} }
// The buildRpm does not generate the folder correctly, manually // The buildRpm does not generate the folder correctly, manually
@ -613,7 +619,7 @@ function release_rpm(arch, done) {
requires: 'libgconf-2-4', requires: 'libgconf-2-4',
prefix: '/opt', prefix: '/opt',
files: files:
[ { cwd: path.join(APPS_DIR, pkg.name, arch), [ { cwd: path.join(appDirectory, pkg.name, arch),
src: '*', src: '*',
dest: `${LINUX_INSTALL_DIR}/${pkg.name}` } ], dest: `${LINUX_INSTALL_DIR}/${pkg.name}` } ],
postInstallScript: [`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${pkg.name}/${pkg.name}.desktop`], postInstallScript: [`xdg-desktop-menu install ${LINUX_INSTALL_DIR}/${pkg.name}/${pkg.name}.desktop`],
@ -656,7 +662,7 @@ function getLinuxPackageArch(type, arch) {
return packArch; return packArch;
} }
// Create distribution package for macOS platform // Create distribution package for macOS platform
function release_osx64() { function release_osx64(appDirectory) {
var appdmg = require('gulp-appdmg'); var appdmg = require('gulp-appdmg');
// The appdmg does not generate the folder correctly, manually // The appdmg does not generate the folder correctly, manually
@ -666,7 +672,7 @@ function release_osx64() {
return gulp.src(['.']) return gulp.src(['.'])
.pipe(appdmg({ .pipe(appdmg({
target: path.join(RELEASE_DIR, getReleaseFilename('macOS', 'dmg')), target: path.join(RELEASE_DIR, getReleaseFilename('macOS', 'dmg')),
basepath: path.join(APPS_DIR, pkg.name, 'osx64'), basepath: path.join(appDirectory, pkg.name, 'osx64'),
specification: { specification: {
title: 'Betaflight Configurator', title: 'Betaflight Configurator',
contents: [ contents: [
@ -698,7 +704,7 @@ function createDirIfNotExists(dir) {
} }
// Create a list of the gulp tasks to execute for release // Create a list of the gulp tasks to execute for release
function listReleaseTasks(done) { function listReleaseTasks(appDirectory) {
var platforms = getPlatforms(); var platforms = getPlatforms();
@ -710,47 +716,49 @@ function listReleaseTasks(done) {
if (platforms.indexOf('linux64') !== -1) { if (platforms.indexOf('linux64') !== -1) {
releaseTasks.push(function release_linux64_zip() { releaseTasks.push(function release_linux64_zip() {
return release_zip('linux64'); return release_zip('linux64', appDirectory);
}); });
releaseTasks.push(function release_linux64_deb(done) { releaseTasks.push(function release_linux64_deb(done) {
return release_deb('linux64', done); return release_deb('linux64', appDirectory, done);
}); });
releaseTasks.push(function release_linux64_rpm(done) { releaseTasks.push(function release_linux64_rpm(done) {
return release_rpm('linux64', done); return release_rpm('linux64', appDirectory, done);
}); });
} }
if (platforms.indexOf('linux32') !== -1) { if (platforms.indexOf('linux32') !== -1) {
releaseTasks.push(function release_linux32_zip() { releaseTasks.push(function release_linux32_zip() {
return release_zip('linux32'); return release_zip('linux32', appDirectory);
}); });
releaseTasks.push(function release_linux32_deb(done) { releaseTasks.push(function release_linux32_deb(done) {
return release_deb('linux32', done); return release_deb('linux32', appDirectory, done);
}); });
releaseTasks.push(function release_linux32_rpm(done) { releaseTasks.push(function release_linux32_rpm(done) {
return release_rpm('linux32', done); return release_rpm('linux32', appDirectory, done);
}); });
} }
if (platforms.indexOf('armv7') !== -1) { if (platforms.indexOf('armv7') !== -1) {
releaseTasks.push(function release_armv7_zip() { releaseTasks.push(function release_armv7_zip() {
return release_zip('armv7'); return release_zip('armv7', appDirectory);
}); });
} }
if (platforms.indexOf('osx64') !== -1) { if (platforms.indexOf('osx64') !== -1) {
releaseTasks.push(release_osx64); releaseTasks.push(function () {
return release_osx64(appDirectory);
});
} }
if (platforms.indexOf('win32') !== -1) { if (platforms.indexOf('win32') !== -1) {
releaseTasks.push(function release_win32(done) { releaseTasks.push(function release_win32(done) {
return release_win('win32', done); return release_win('win32', appDirectory, done);
}); });
} }
if (platforms.indexOf('win64') !== -1) { if (platforms.indexOf('win64') !== -1) {
releaseTasks.push(function release_win64(done) { releaseTasks.push(function release_win64(done) {
return release_win('win64', done); return release_win('win64', appDirectory, done);
}); });
} }