Script to update web-ifc.
This commit is contained in:
parent
b5d0ac9ca0
commit
267a659dfb
@ -29,7 +29,8 @@
|
||||
"fflate": "0.7.1",
|
||||
"jquery": "3.5.1",
|
||||
"rhino3dm": "7.7.0",
|
||||
"three": "0.134.0"
|
||||
"three": "0.134.0",
|
||||
"web-ifc": "0.0.28"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"env": {
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
import zipfile
|
||||
import urllib
|
||||
import urllib.request
|
||||
|
||||
from lib import tools_lib as Tools
|
||||
|
||||
@ -44,6 +41,11 @@ fflateFileMap = [
|
||||
[os.path.join ('fflate', 'umd', 'index.js'), os.path.join ('loaders', 'fflate.min.js')],
|
||||
]
|
||||
|
||||
webIfcFileMap = [
|
||||
[os.path.join ('web-ifc', 'web-ifc-api.js'), os.path.join ('loaders', 'web-ifc-api.js')],
|
||||
[os.path.join ('web-ifc', 'web-ifc.wasm'), os.path.join ('loaders', 'web-ifc.wasm')],
|
||||
]
|
||||
|
||||
def PrintInfo (message):
|
||||
print ('INFO: ' + message)
|
||||
|
||||
@ -57,6 +59,11 @@ def UpdateModule (fileMap, moduleDir, libsDir):
|
||||
PrintInfo ('Copying file ' + os.path.split (src)[1])
|
||||
shutil.copy2 (src, dst)
|
||||
|
||||
def FixWebIfcExport (libsDir):
|
||||
apiFilePath = os.path.join (libsDir, 'loaders', 'web-ifc-api.js')
|
||||
regex = re.compile (r'export \{.*\};', re.DOTALL)
|
||||
Tools.ReplaceRegexInFile (apiFilePath, regex, '')
|
||||
|
||||
def Main (argv):
|
||||
toolsDir = os.path.dirname (os.path.abspath (__file__))
|
||||
rootDir = os.path.dirname (toolsDir)
|
||||
@ -71,6 +78,8 @@ def Main (argv):
|
||||
UpdateModule (dracoFileMap, nodeModulesDir, libsDir)
|
||||
UpdateModule (rhino3dmFileMap, nodeModulesDir, libsDir)
|
||||
UpdateModule (fflateFileMap, nodeModulesDir, libsDir)
|
||||
UpdateModule (webIfcFileMap, nodeModulesDir, libsDir)
|
||||
FixWebIfcExport (libsDir)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user