package npm dependency module in binary package

This commit is contained in:
Lee moon soo 2017-01-07 09:51:44 -08:00
parent b655fa6568
commit f494dbd904
2 changed files with 32 additions and 4 deletions

View file

@ -95,5 +95,13 @@
<outputDirectory>/lib/interpreter</outputDirectory>
<directory>../zeppelin-interpreter/target/lib</directory>
</fileSet>
<fileSet>
<outputDirectory>/lib/node_modules/zeppelin-vis</outputDirectory>
<directory>../zeppelin-web/src/app/visualization</directory>
</fileSet>
<fileSet>
<outputDirectory>/lib/node_modules/zeppelin-tabledata</outputDirectory>
<directory>../zeppelin-web/src/app/tabledata</directory>
</fileSet>
</fileSets>
</assembly>

View file

@ -101,10 +101,22 @@ public class ZeppelinServer extends Application {
HeliumApplicationFactory heliumApplicationFactory = new HeliumApplicationFactory();
HeliumVisualizationFactory heliumVisualizationFactory;
heliumVisualizationFactory = new HeliumVisualizationFactory(
new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)),
new File(conf.getRelativeDir("zeppelin-web/src/app/tabledata")),
new File(conf.getRelativeDir("zeppelin-web/src/app/visualization")));
if (isBinaryPackage(conf)) {
/* In binary package, zeppelin-web/src/app/visualization and zeppelin-web/src/app/tabledata
* are copied to lib/node_modules/zeppelin-vis, lib/node_modules/zeppelin-tabledata directory.
* Check zeppelin/zeppelin-distribution/src/assemble/distribution.xml to see how they're
* packaged into binary package.
*/
heliumVisualizationFactory = new HeliumVisualizationFactory(
new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)),
new File(conf.getRelativeDir("lib/node_modules/zeppelin-tabledata")),
new File(conf.getRelativeDir("lib/node_modules/zeppelin-vis")));
} else {
heliumVisualizationFactory = new HeliumVisualizationFactory(
new File(conf.getRelativeDir(ConfVars.ZEPPELIN_DEP_LOCALREPO)),
new File(conf.getRelativeDir("zeppelin-web/src/app/tabledata")),
new File(conf.getRelativeDir("zeppelin-web/src/app/visualization")));
}
this.helium = new Helium(
conf.getHeliumConfPath(),
@ -367,5 +379,13 @@ public class ZeppelinServer extends Application {
return singletons;
}
/**
* Check if it is source build or binary package
* @return
*/
private static boolean isBinaryPackage(ZeppelinConfiguration conf) {
return !new File(conf.getRelativeDir("zeppelin-web")).isDirectory();
}
}