Revision 348 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.main/src/main/java/org/gvsig/scripting/main/Main.java

View differences:

Main.java
63 63

  
64 64
	}
65 65

  
66
	private void registerPluginFolders(File pluginsFolder) {
67

  
68
	    File[] folders = pluginsFolder.listFiles();
69
	    for (File folder : folders) {
70
		    File scriptsFolder = new File(folder,"scripting/scripts");
71
		    if( scriptsFolder.exists() ) {
72
		    	manager.registerSystemFolder(folder.getName(), scriptsFolder);
73
		    }
74
		    File libFolder = new File(folder,"scripting/lib");
75
		    if( libFolder.exists() ) {
76
		    	manager.addLibFolder(libFolder);
77
		    }
78
		}
79
	}
80
	
66 81
	public void doMain(String args[]) {
67 82

  
68 83
		new DefaultLibrariesInitializer().fullInitialize();
......
78 93
		options.addOption("c", "show-composer", false,
79 94
				"Show the composer window");
80 95
		options.addOption("r", "run", true, "Run the specified script");
96
		options.addOption("f", "plugins-folder", true, "Register scripts and libs folder in the plugins located in this location");
81 97
		options.addOption("s", "show", true, "Show the specified dialog");
82 98
		options.addOption("h", "home", true,
83 99
				"Specify for the home of the script framework");
......
88 104
			if (line.hasOption("home")) {
89 105
				manager.setHomeFolder(new File(line.getOptionValue("home")));
90 106
			}
107
			if (line.hasOption("plugins-folder")) {
108
				registerPluginFolders(new File(line.getOptionValue("plugins-folder")));
109
			}
91 110
			if (line.hasOption("show-launcher")) {
92 111
				showLauncher();
93 112
			}

Also available in: Unified diff