From 665a419e4957da97e9455dce2f0135ea0f3994c9 Mon Sep 17 00:00:00 2001 From: Viktor Kovacs Date: Sun, 28 Mar 2021 12:02:46 +0200 Subject: [PATCH] Create test build without analytics. --- appveyor.yml | 2 +- tools/create_package.py | 17 ++++++++++++----- tools/sandbox/embed_selfhost.html | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d7c9c6d..4717929 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,7 @@ test_script: - npm run test artifacts: - - path: build\package\* + - path: build\final\package\* deploy: description: 'News:\n- ...' diff --git a/tools/create_package.py b/tools/create_package.py index bc78d40..28678f1 100644 --- a/tools/create_package.py +++ b/tools/create_package.py @@ -37,7 +37,7 @@ def CompressFiles (inputFiles, outputFile): return False return True -def CreateDestinationDir (config, rootDir, websiteDir, version): +def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild): if not os.path.exists (websiteDir): os.makedirs (websiteDir) @@ -71,7 +71,7 @@ def CreateDestinationDir (config, rootDir, websiteDir, version): metaContent = Tools.GetFileContent (metaFile) replacer.ReplaceTokenContent ('', '', metaContent) analyticsFile = os.path.join (rootDir, 'tools', 'website_analytics_data.txt') - if os.path.exists (analyticsFile): + if os.path.exists (analyticsFile) and not testBuild: analyticsContent = Tools.GetFileContent (analyticsFile) replacer.ReplaceTokenContent ('', '', analyticsContent) scriptFile = os.path.join (rootDir, 'tools', 'website_script_data.txt') @@ -96,12 +96,19 @@ def Main (argv): os.chdir (currentDir) rootDir = os.path.abspath ('..') - buildDir = os.path.join (rootDir, 'build') + + testBuild = False + buildDir = os.path.join (rootDir, 'build', 'final') + if len (argv) >= 2 and argv[1] == 'test': + testBuild = True + buildDir = os.path.join (rootDir, 'build', 'test') + PrintInfo ('Creating test build.') + websiteDir = os.path.join (buildDir, 'website') packageDir = os.path.join (buildDir, 'package') if os.path.exists (buildDir): shutil.rmtree (buildDir) - + config = None with open ('config.json') as configJson: config = json.load (configJson) @@ -120,7 +127,7 @@ def Main (argv): version = GetVersion (rootDir) PrintInfo ('Create build directory') - CreateDestinationDir (config, rootDir, websiteDir, version) + CreateDestinationDir (config, rootDir, websiteDir, version, testBuild) PrintInfo ('Compress importer sources.') compressResult = CompressFiles (config['importer_files'], os.path.join (websiteDir, 'o3dv', 'o3dv.min.js')) diff --git a/tools/sandbox/embed_selfhost.html b/tools/sandbox/embed_selfhost.html index c75d0e8..5c435f0 100644 --- a/tools/sandbox/embed_selfhost.html +++ b/tools/sandbox/embed_selfhost.html @@ -9,7 +9,7 @@ Online 3D Viewer - +