File: create_static_workspace.js

package info (click to toggle)
openscenegraph 1.2.0-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,924 kB
  • ctags: 25,229
  • sloc: cpp: 239,326; ansic: 2,178; sh: 1,990; yacc: 548; perl: 237; makefile: 227; lex: 151
file content (33 lines) | stat: -rw-r--r-- 1,313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* create_static_workspace - Copyright (C) 2006 Joran Jessurun 
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
 *
 * Made by Joran Jessurun (A.J.Jessurun@tue.nl)
 */ 
var fso=WScript.createObject("Scripting.FileSystemObject");
var ForReading=1;
var ForWriting=2;

WScript.echo("Creating OpenSceneGraphStatic.dsw from OpenSceneGraph.dsw");

var source=fso.openTextFile("OpenSceneGraph.dsw",ForReading);
var destin=fso.openTextFile("OpenSceneGraphStatic.dsw",ForWriting,true);
var state=0; // 0=copy, 1=skip
while(!source.atEndOfStream) {
  line=source.readLine();
  if(/Begin Project Dependency/.test(line)) state=1;
  if(state==0) destin.writeLine(line);
  if(/End Project Dependency/.test(line)) state=0;  
}
source.close();
destin.close();

WScript.echo("Done");