Alternate Script to create projects using ProjectCreator and update to jar
Hi,
I have made a small adjustment to one of the template files in the project-creator.jar. This means that *all* eclipse projects will be generated with a classpath that includes the variable GS_HOME . This variable will point to whatever you (the owner of the running eclipse instance) determines it should point to.
BTW: It needs to point to the home directory for your installation of GigaSpacesXAP6.0
To accomplish this:
1) create the project using projectcreator
2) import the project into eclipse version 3.3 (europa)
3) right-click on the project and select
Build Path | Configure Build Path...
4) select
Add Variable | Configure Variables...
5) select
New...
6) enter the following in the two fields
Name: GS_HOME
Path: [browse_to_the_home_directory_of_your_installation_of_GigaSpacesXAP6.0]
(
On my system, in eclipse I have configured GS_HOME to point to
c:\GigaSpacesXAP6.0
)
7) click OK
8) do a rebuild
9) ignore the warning that the path is not a jar file (we know that already)
10) Find your way back to the project and look: the red x is gone!
The Variable GS_HOME should now be resolved and reusable for future projects in eclipse.
In addition, I noticed mucho redundancy in the scripts I offered in my previous posts.
The eclipse and intellij versions are now identical except for the value provided for the IDE variable.
The following scripts are hopefully clearer alternates you can use to create the various projects:
____________________________
file: createPublisher.cmd
____________________________
rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####
rem This script starts the projectCreator so as to create a PU containing a TimerTask – a SpringBean that gets invoked over and over again by a Timer. Configure how often to do this in the PU.xml Note this is good for a feed or driver and usually means you will elect to have a remote space.
rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.
rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0
rem Script-specific Configuration Settings:
set PROJECT_NAME=Publisher
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc_timerTask
set PU_TEMPLATE_NAME=pu.xmlsrc_timerTask
rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite
call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%
____________________________
____________________________
file: createNotifyListener.cmd
____________________________
rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####
rem This script starts the projectCreator so as to create a PU containing a NotifyContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. Note this is good for a listener (a take is not performed as part of the NotifyContainer operation) and could be implemented with either a remote or embedded space.
rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.
rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0
rem Script-specific Configuration Settings:
set PROJECT_NAME=NotifyListener
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc
set PU_TEMPLATE_NAME=pu.xmlsrc_notifyContainer
rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite
call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%
_______________________________
file: createPollingWorker.cmd
____________________________
rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####
rem This script starts the projectCreator so as to create a PU containing a PollingContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. NB: The PollingContainer removes (takes) the interesting information from the Space!
rem Note this is good for a worker and usually means you will elect to have an embedded space.
rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.
rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0
rem Script-specific Configuration Settings:
set PROJECT_NAME=PollingWorker
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc
set PU_TEMPLATE_NAME=pu.xmlsrc
rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite
call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%
________________________________
Cheers,
Owen.