Skip to content

Commit

Permalink
Merge pull request #1104 from codeborne/exclude-docviewer
Browse files Browse the repository at this point in the history
Fixes #1103 do not include `docviewer` module by default
  • Loading branch information
asolntsev authored Feb 13, 2017
2 parents 3f739e8 + 43ddf7b commit 14c2d07
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions framework/pym/play/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def new(app, args, env, cmdloader=None):
print "~"

# Configure modules
runDepsAfter = False
for m in md:
# Check dependencies.yml of the module
depsYaml = os.path.join(env["basedir"], 'modules/%s/conf/dependencies.yml' % m)
Expand All @@ -106,12 +105,10 @@ def new(app, args, env, cmdloader=None):
try:
moduleDefinition = re.search(r'self:\s*(.*)\s*', deps).group(1)
replaceAll(os.path.join(app.path, 'conf/dependencies.yml'), r'- play\n', '- play\n - %s\n' % moduleDefinition )
runDepsAfter = True
except Exception:
pass

if runDepsAfter:
cmdloader.commands['dependencies'].execute(command='dependencies', app=app, args=['--sync'], env=env, cmdloader=cmdloader)
cmdloader.commands['dependencies'].execute(command='dependencies', app=app, args=['--sync'], env=env, cmdloader=cmdloader)

print "~ OK, the application is created."
print "~ Start it with : play run %s" % sys.argv[2]
Expand Down
4 changes: 0 additions & 4 deletions framework/src/play/Play.java
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,6 @@ public static void loadModules(VirtualFile appRoot) {
if (Play.runingInTestMode()) {
addModule(appRoot, "_testrunner", new File(Play.frameworkPath, "modules/testrunner"));
}

if (Play.mode == Mode.DEV) {
addModule(appRoot, "_docviewer", new File(Play.frameworkPath, "modules/docviewer"));
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions framework/src/play/deps/YamlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ public ModuleDescriptorParser getParser() {
if(depName.matches("play\\s+->\\s+secure") || depName.equals("secure")) {
depName = "play -> secure " + System.getProperty("play.version");
}
if(depName.matches("play\\s+->\\s+docviewer") || depName.equals("docviewer")) {
depName = "play -> docviewer " + System.getProperty("play.version");
}

// Pattern compile to match [organisation name] - > [artifact] [revision] [classifier]
Matcher m = Pattern.compile("([^\\s]+)\\s*[-][>]\\s*([^\\s]+)\\s+([^\\s]+)(\\s+[^\\s]+)?.*").matcher(depName);
Expand Down
1 change: 1 addition & 0 deletions resources/application-skel/conf/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

require:
- play
- play -> docviewer

0 comments on commit 14c2d07

Please sign in to comment.