⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gwtcompile.java

📁 Local Lucene ==================== Provide geographical based searching to lucene in an efficent ma
💻 JAVA
字号:
/* * Copyright 2006 pjaol.com *  * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at *  * http://www.apache.org/licenses/LICENSE-2.0 *  * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. *  * $Id: GWTCompile.java,v 1.3 2007/01/08 20:28:54 pjaol Exp $ * $Log: GWTCompile.java,v $ * Revision 1.3  2007/01/08 20:28:54  pjaol * Updated License, added a README * */package com.pjaol.gwt.ant;import org.apache.tools.ant.Project;import org.apache.tools.ant.Task;import org.apache.tools.ant.types.CommandlineJava;import org.apache.tools.ant.types.EnumeratedAttribute;import org.apache.tools.ant.types.Path;import com.google.gwt.dev.GWTCompiler;/** * @author Patrick O'Leary (pjaol@pjaol.com) *  * */public class GWTCompile extends Task {		public static class logLevels extends EnumeratedAttribute{		@Override		/**		 * log values for GWTCompiler		 */		public String[] getValues() {			// ide's such as eclipse, xdoclet editor lower case the enumerated values			return new String[] {"error", "warn", "info", "trace", "debug", "spam", "all"};		}			}	public static class styleTypes extends EnumeratedAttribute {		@Override		public String[] getValues() {			return new String[] {"obf", "pretty", "detailed"};		}			}	private int argpos = 0;	private String args[] = new String[8];	private String gen;	private String logLevel; 			private String module;	private String out;		private String src;	private String style;		private void addArg(String key, String value) {		args[argpos]= key;		argpos++;		args[argpos]= value;		argpos++;	}		public void execute () {				CommandlineJava cmd = new CommandlineJava();		Path cp = cmd.createClasspath(getProject()).concatSystemClasspath();				cmd.setClassname(GWTCompiler.class.getName());		if (gen !=null) {						addArg("-gen",gen);		}			if (out != null) {			addArg("-out",out);		}				if (style != null){			addArg("-style",style);		}				if(logLevel != null){			addArg("-logLevel", logLevel);		}				if (module != null) {			log("module = " + module , Project.MSG_INFO);			args[argpos] = module;			argpos++;		}				        cp.add(new Path(getProject(), src));    		new TaskUtils().run(getProject(),   cp,GWTCompiler.class.getName(), getArgs(), true);		         	}		private String[] getArgs() {		String[] a = new String[argpos];		for (int x = 0; x< argpos; x++){			a[x] = args[x];		}				return a;	}	public String getGen() {		return gen;	}	public String getLogLevel() {		return logLevel;	}	public String getModule() {		return module;	}		public String getOut() {		return out;	}	public String getSrc() {		return src;	}	public String getStyle() {		return style;	}	public void setGen(String gen) {		this.gen = gen;	}		public void setLogLevel(logLevels logLevel) {		this.logLevel = logLevel.getValue().toUpperCase();	}	public void setModule(String module) {		this.module = module;	}		public void setOut(String out) {		this.out = out;	}		public void setSrc(String src){		this.src = src;	}		public void setStyle(styleTypes style) {		this.style = style.getValue().toUpperCase();	}	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -