Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / clix / testSh.groovy @ 479

History | View | Annotate | Download (3.2 kB)

1
/**
2
 * Main.
3
 *
4
 * @param args the args
5
 */
6
// Copyright © 2010-2013 ENS de Lyon.
7
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
8
// Lyon 2, University of Franche-Comté, University of Nice
9
// Sophia Antipolis, University of Paris 3.
10
// 
11
// The TXM platform is free software: you can redistribute it
12
// and/or modify it under the terms of the GNU General Public
13
// License as published by the Free Software Foundation,
14
// either version 2 of the License, or (at your option) any
15
// later version.
16
// 
17
// The TXM platform is distributed in the hope that it will be
18
// useful, but WITHOUT ANY WARRANTY; without even the implied
19
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
// PURPOSE. See the GNU General Public License for more
21
// details.
22
// 
23
// You should have received a copy of the GNU General
24
// Public License along with the TXM platform. If not, see
25
// http://www.gnu.org/licenses.
26

    
27
//
28
// This file is part of the TXM platform.
29
//
30
// The TXM platform is free software: you can redistribute it and/or modif y
31
// it under the terms of the GNU General Public License as published by
32
// the Free Software Foundation, either version 3 of the License, or
33
// (at your option) any later version.
34
//
35
// The TXM platform is distributed in the hope that it will be useful,
36
// but WITHOUT ANY WARRANTY; without even the implied warranty of
37
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38
// GNU General Public License for more details.
39
//
40
// You should have received a copy of the GNU General Public License
41
// along with the TXM platform.  If not, see <http://www.gnu.org/licenses/>.
42
// 
43
// 
44
// 
45
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun. 06 mai 2013) $
46
// $LastChangedRevision: 2386 $
47
// $LastChangedBy: mdecorde $ 
48
//
49
package org.txm.scripts.clix;
50
import java.io.File;
51
import java.util.Properties;
52

    
53
import org.txm.importer.filters.Filter;
54
import org.txm.utils.ProcessBuilderBuilder;
55
import groovy.lang.GroovyClassLoader;
56

    
57
import org.txm.Toolbox
58

    
59
/**
60
 * test sh wrapper
61
 */
62

    
63
//ProcessBuilderBuilder.build(new File("src/groovy/org/txm/scripts/sh-wrapper-definition.xml"), new File("src/groovy/org/textometrie/scripts/Sh.groovy"));
64
// TODO: Auto-generated Javadoc
65

    
66
/* (non-Javadoc)
67
 * @see groovy.lang.Script#run()
68
 */
69
ProcessBuilderBuilder.build(new File("groovy/org/txm/scripts/sh-wrapper-definition.xml"), new File("groovy/org/textometrie/scripts/Sh.groovy"));
70

    
71
GroovyClassLoader gcl = new GroovyClassLoader();
72

    
73
def aScript
74

    
75
try
76
{
77
        gcl.addClasspath(".");
78
        //Class clazz = gcl.parseClass(new File("src/groovy/org/txm/scripts/Sh.groovy"));
79
        Class clazz = gcl.parseClass(new File("groovy/org/txm/scripts/Sh.groovy"));
80
        aScript = clazz.newInstance("/bin/");
81

    
82
}
83
catch(Exception e)
84
{        System.err.println(e);
85
        return null;
86
}
87
String regpath ="~/.txm/registry";
88
//String regpath ="C:/Documents and Settings/sheiden/.txm/registry";
89
String execpath = "~/Bureau/trunkCWB/cwb-3.0/cqp/";
90
//String execpath ="C:/Projets/Textom�trie/Logiciel/Toolbox/0.4.5/toolbox/src/main/C/cwb-3.0/utils/cwb-decode.exe";
91
aScript.setc("\""+execpath+" -C -s 0 -e 5 -r '"+regpath+"' DISCOURS -P word\"")
92
//aScript.shexe()
93
aScript.sh()