简体   繁体   English

GWT托管模式脚本Windows

[英]GWT Hosted Mode Script Windows

The company I work for uses Mac computers exclusively. 我工作的公司专门使用Mac计算机。 While I like my Mac, it is only a 13" laptop so I decided to setup my environment on my Windows pc as I have two 24" monitors to work from. 当我喜欢Mac时,它只是一台13英寸的笔记本电脑,所以我决定在Windows PC上设置我的环境,因为我有两个24英寸显示器可以工作。 I want to be able to use devMode so I can update the UI without having to recompile everything. 我希望能够使用devMode,以便无需重新编译所有内容即可更新UI。 I was wondering if there is an easy way to convert a bash shell script into a windows batch file. 我想知道是否有一种简单的方法可以将bash shell脚本转换为Windows批处理文件。 Im not experienced at all in creating batch files so any help would be greatly appreciated 我在创建批处理文件方面根本没有经验,因此任何帮助将不胜感激

edit: I used Cygwin and I get the error: 编辑:我用Cygwin和我得到错误:

$ ./devMode_osx.sh
Listening for transport dt_socket at address: 5006
Error: Could not find or load main class com.google.gwt.dev.DevMode

Here's the file 这是文件

#!/bin/sh
#
# Startup script for hosted mode.
# You have to add MAVEN_REPO to your variables; for example:
#
# export MAVEN_REPO="/Users/james/.m2/repository"
#
MAVEN_REPO="C:/Users/James/.m2/repository"
JAVA_HOME="C:/Program Files (x86)/Java/jdk1.6.0_38"
PATH=$JAVA_HOME/bin:$PATH

APPDIR=`dirname $0`;

BASE_JAVA_SRC="$APPDIR/../src/main/java"
BASE_JAVA_CLASSES="$APPDIR/../target/classes"
BASE_RESOURCES="$APPDIR/../src/main/webapp/"
DOMAIN_JAVA_SRC="$APPDIR/../../sample-domain/src/main/java"
DOMAIN_JAVA_CLASSES="$APPDIR/../../sample-domain/target/classes"
DOMAIN_JAVA_RESOURCES="$APPDIR/../../sample-domain/src/main/resources"

GWT_USER="$MAVEN_REPO/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar"
GWT_DEV="$MAVEN_REPO/com/google/gwt/gwt-dev/2.3.0/gwt-dev-2.3.0.jar"
JAVAX_VALIDATION="$MAVEN_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-        1.0.0.GA.jar"
JAVAX_VALIDATION_SRC="$MAVEN_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar"

JVMARGS="-agentlib:jdwp=transport=dt_socket,address=5006,server=y,suspend=n"

#MP: run HostedMode with 'war' parameter set, as below, to specify, where the gwt output files are written to
#-war $BASE_RESOURCES

java $JVMARGS -XX:PermSize=256m -Xmx900M -Xms900M -cp "$BASE_JAVA_SRC:$BASE_JAVA_CLASSES:$BASE_RESOURCES:$GWT_USER:$GWT_DEV:$JAVAX_VALIDATION:$JA    VAX_VALIDATION_SRC:$DOMAIN_JAVA_SRC:$DOMAIN_JAVA_CLASSES:$DOMAIN_JAVA_RESOURCES" \
com.google.gwt.dev.DevMode \
-startupUrl Sample.html com.ngcompliance.web.gwt.Sample\
-noserver -port 9999 -war $BASE_RESOURCES

Two approaches: 两种方法:

  1. Use Cygwin (www.cygwin.com) to run a Bash shell script under Windows. 使用Cygwin(www.cygwin.com)在Windows下运行Bash shell脚本。

  2. Take a basic batch programming tutorial. 学习基本的批处理编程教程。

    Pay attention to the part of setting and accessing variables. 注意设置和访问变量的部分。

    And then try to modify your bash script 然后尝试修改您的bash脚本


    Hint 1 setting variables 提示1设置变量

    instead of 代替

     MAVEN_REPO="C:/Users/James/.m2/repository" 

    use 采用

     SET MAVEN_REPO="C:/Users/James/.m2/repository" 

    Hint 2 using variables 提示2使用变量

    instead of 代替

     BASE_JAVA_SRC="$APPDIR/../src/main/java" 

    use 采用

     SET BASE_JAVA_SRC="%APPDIR%/../src/main/java" 

    Hint 3 review use of external commands and SO idiosyncrasies 提示3回顾外部命令和SO特质的使用

    instead of 代替

     APPDIR=`dirname $0`; 

    use 采用

     SET APPDIR=%~dp0 

Can you just not use eclipse, gpe plugin and maven plugin. 您可以不使用eclipse,gpe插件和maven插件吗?

  1. Gpe - https://developers.google.com/eclipse/ Gpe- https://developers.google.com/eclipse/

  2. Gwt gpe faq -https://developers.google.com/eclipse/docs/faq Gwt gpe常见问题解答-https://developers.google.com/eclipse/docs/faq

  3. Gwt with maven - htpp://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven Gwt与Maven-htpp://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM