Changeset 3398

Show
Ignore:
Timestamp:
03/08/10 17:37:48 (2 years ago)
Author:
jeichar
Message:

updated readme and added command line run

Location:
print/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • print/trunk/README

    r3397 r3398  
    33 
    44 
    5 To build: 
    6  
    7 Install Gradle (http://www.gradle.org/) 
    8  
    9 Execute the following command(): 
    10   gradle 
     5== build == 
     6- Install Gradle (http://www.gradle.org/) 
     7- Execute the following command(): 
     8  > gradle 
    119 
    1210This will build three artifacts:  print-servlet-xxx.war, print-lib.jar, print-standalone.jar 
    1311 
    14 To deploy: 
     12== Deploy == 
     13The following command will build and upload all artifacts to the dev.mapfish.org repository. 
     14  > gradle upload -DsshPassphrase=...  
    1515 
    16 > gradle upload -DsshPassphrase=...  
     16To use in eclipse: 
     17- Create eclipse project metadata: 
     18  > gradle eclipse 
     19- Import project into eclipse 
     20 
     21== Run from commandline == 
     22The following command will run the mapfish printer.  If you do no supply any -Dxxx args then all argument options will be listed. 
     23  > gradle run -Dconfig=samples/config.yaml -Dspec=samples/spec.json -Doutput=/tmp/print-out.pdf 
     24   
  • print/trunk/build.gradle

    r3397 r3398  
    6666 
    6767    ant.jar(destfile: "${archivePath}", manifest: "$dest/META-INF/MANIFEST.MF") { 
    68       fileset(dir: dest, excludes: "META-INF/,LICENSE") 
     68      fileset(dir: dest) { 
     69        exclude(name: "META-INF/") 
     70        exclude(name: "LICENSE") 
     71      } 
    6972    } 
    7073    ant.delete(dir: dest) 
     
    104107  } 
    105108} 
     109def prop(key) { 
     110  return System.getProperty(key) == null ? null : "--${key}=${System.getProperty(key)}" 
     111} 
     112 
     113task run(dependesOn: compileJava) << { 
     114  String warning = """[WARNING] config parameter is required.  
     115   
     116  Usage: 
     117    gradle run -Dconfig={value} [-Dspec={value}] [-Dverbose={value}] [-Doutput={value}] [-DclientConfig] [-Dreferer={value}] [-Dlog4jConfig={value}] 
     118  Params: 
     119    -Dconfig={String}: Filename for the configuration (templates&CO) 
     120    -Dspec={String}: The location of the description of what has to be printed. By default, STDIN (defaults to [null]) 
     121    -Dverbose={int}: Used only if log4jConfig is not specified. 3 if you want everything, 2 if you want the debug information (stacktraces are shown), 1 for infos and 0 for only warnings and errors (defaults to [1]) 
     122    -Doutput={String}: The destination file. By default, STDOUT (defaults to [null]) 
     123    -DclientConfig={on|off}: Get the config for the client form. Doesn't generate a PDF (defaults to [off]) 
     124    -Dreferer={String}: Referer address to use when doing queries (defaults to [null]) 
     125    -Dlog4jConfig={String}: Property file for the log4j configuration (defaults to [null]) 
     126     
     127  Example: 
     128    gradle run -Dconfig=samples/config.yaml -Dspec=samples/spec.json -Doutput=/tmp/print-out.pdf 
     129     
     130     
     131  """ 
     132 
     133  args = [prop("config"),prop("spec"),prop("output"),prop("verbose"),prop("clientConfig"),prop("referer"),prop("log4jConfig")] 
     134  if(prop("config") == null) { 
     135    println(warning) 
     136  } else {   
     137    ant.java(classname: 'org.mapfish.print.ShellMapPrinter', fork: false, logError: false, 
     138             classpath: "${sourceSets.main.runtimeClasspath.asPath}")  { 
     139        for(a in args.findAll {it!=null}){ 
     140          arg(value: a) 
     141        } 
     142     } 
     143   } 
     144} 
    106145 
    107146/* 
    108 This task is not ready for prime time 
     147This task is not ready for prime time.  I do not know what parameters the class expects 
     148 
    109149task runWarTest(dependsOn: jettyRunWar) << { 
    110150  description = "run load test on embedded jetty" 
     
    125165}*/ 
    126166 
     167 
     168/* 
     169task install(overwrite: true) << { 
     170  env = System.getenv() 
     171  sep = File.separator 
     172  localRepo = env['MAVEN_REPO'] ?: env['HOME']+"${sep}.m2${sep}repository" 
     173  repository(url: "file://"+localRepo) 
     174  snapshotRepository(url: "file://"+localRepo) 
     175   
     176  addFilter('lib') { artifact, file -> 
     177    artifact.name.contains 'print-lib' 
     178  } 
     179   
     180  addFilter('standalone') { artifact, file -> 
     181    artifact.name.contains 'print-standalone' 
     182  } 
     183   
     184  addFilter('war') { artifact, file -> 
     185    artifact.name.contains 'print-servlet' 
     186  } 
     187} 
     188*/