@@ -36,6 +36,18 @@ def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild):
36
36
shutil .copytree (os .path .join (rootDir , 'website' , 'css' , 'O3DVIcons' ), os .path .join (websiteDir , 'o3dv' , 'O3DVIcons' ))
37
37
shutil .copytree (os .path .join (rootDir , 'website' , 'info' ), os .path .join (websiteDir , 'info' ))
38
38
39
+ pluginFiles = []
40
+ pluginsDir = os .path .join (rootDir , 'plugins' )
41
+ if os .path .exists (pluginsDir ):
42
+ for pluginFile in os .listdir (pluginsDir ):
43
+ if os .path .splitext (pluginFile )[1 ] != '.js' :
44
+ continue
45
+ websitePluginsDir = os .path .join (websiteDir , 'plugins' );
46
+ if not os .path .exists (websitePluginsDir ):
47
+ os .makedirs (websitePluginsDir )
48
+ shutil .copy2 (os .path .join (pluginsDir , pluginFile ), os .path .join (websitePluginsDir , pluginFile ))
49
+ pluginFiles .append ('plugins/' + pluginFile )
50
+
39
51
websiteLibFiles = config ['website_lib_files' ]
40
52
websiteFiles = [
41
53
'o3dv/o3dv.website.min.css' ,
@@ -54,6 +66,7 @@ def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild):
54
66
replacer = Tools .TokenReplacer (htmlFilePath , False )
55
67
replacer .ReplaceTokenFileLinks ('<!-- website libs start -->' , '<!-- website libs end -->' , websiteLibFiles , version )
56
68
replacer .ReplaceTokenFileLinks ('<!-- website start -->' , '<!-- website end -->' , websiteFiles , version )
69
+ replacer .ReplaceTokenFileLinks ('<!-- plugins start -->' , '<!-- plugins end -->' , pluginFiles , version )
57
70
initScriptContent = ''
58
71
initScriptContent += '<script type="text/javascript">' + replacer .eolChar
59
72
initScriptContent += ' OV.StartWebsite (\' libs\' );' + replacer .eolChar
@@ -64,19 +77,15 @@ def CreateDestinationDir (config, rootDir, websiteDir, version, testBuild):
64
77
embedInitScriptContent += '</script>'
65
78
replacer .ReplaceTokenContent ('<!-- website init start -->' , '<!-- website init end -->' , initScriptContent )
66
79
replacer .ReplaceTokenContent ('<!-- embed init start -->' , '<!-- embed init end -->' , embedInitScriptContent )
67
- metaFile = os .path .join (rootDir , 'tools ' , 'website_meta_data.txt' )
80
+ metaFile = os .path .join (rootDir , 'plugins ' , 'website_meta_data.txt' )
68
81
if os .path .exists (metaFile ):
69
82
metaContent = Tools .GetFileContent (metaFile )
70
83
replacer .ReplaceTokenContent ('<!-- meta start -->' , '<!-- meta end -->' , metaContent )
71
- analyticsFile = os .path .join (rootDir , 'tools ' , 'website_analytics_data.txt' )
84
+ analyticsFile = os .path .join (rootDir , 'plugins ' , 'website_analytics_data.txt' )
72
85
if os .path .exists (analyticsFile ) and not testBuild :
73
86
analyticsContent = Tools .GetFileContent (analyticsFile )
74
87
replacer .ReplaceTokenContent ('<!-- analytics start -->' , '<!-- analytics end -->' , analyticsContent )
75
- scriptFile = os .path .join (rootDir , 'tools' , 'website_script_data.txt' )
76
- if os .path .exists (scriptFile ):
77
- scriptContent = Tools .GetFileContent (scriptFile )
78
- replacer .ReplaceTokenContent ('<!-- script start -->' , '<!-- script end -->' , scriptContent )
79
- introFile = os .path .join (rootDir , 'tools' , 'website_intro_data.txt' )
88
+ introFile = os .path .join (rootDir , 'plugins' , 'website_intro_data.txt' )
80
89
if os .path .exists (introFile ):
81
90
introContent = Tools .GetFileContent (introFile )
82
91
replacer .ReplaceTokenContent ('<!-- intro start -->' , '<!-- intro end -->' , introContent )
0 commit comments