├── gradle.properties ├── .gitignore ├── src ├── test │ ├── resources │ │ ├── 21-dependencymanagement │ │ │ ├── extDir │ │ │ │ └── test.txt │ │ │ ├── extDir2 │ │ │ │ └── test.txt │ │ │ ├── settings.gradle │ │ │ ├── lib │ │ │ │ ├── junit-4.8.2.jar │ │ │ │ └── google-collections-1.0.jar │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── AppWithDep.java │ │ │ └── build.gradle │ │ ├── 36-pgo │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── Test.java │ │ ├── 12-jvmargs │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── JVMArgs.java │ │ │ └── build.gradle │ │ ├── 31-package-files │ │ │ ├── packagefiles │ │ │ │ ├── custom.file │ │ │ │ └── subdir │ │ │ │ │ └── subdir.file │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 46-stop-task │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── App.java │ │ │ └── build.gradle │ │ ├── 47-timeouts │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── App.java │ │ │ └── build.gradle │ │ ├── 06-multiapp │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ └── HelloWorld2.java │ │ │ └── build.gradle │ │ ├── 07-testrun │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── packagefiles │ │ │ │ │ │ ├── custom.file │ │ │ │ │ │ └── subdir │ │ │ │ │ │ └── subdir.file │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 09-slimdown │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 39-jethome │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 01-helloworld │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 02-withdependency │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── AppWithDep.java │ │ │ └── build.gradle │ │ ├── 03-helloswing │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── icon.ico │ │ │ │ │ └── java │ │ │ │ │ └── HelloSwing.java │ │ │ └── build.gradle │ │ ├── 08-optrtfiles │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 11-trialversion │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 13-protectdata │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 14-osx-app-bundle │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── icon.icns │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── excelsior │ │ │ │ │ └── HelloSwing.java │ │ │ └── build.gradle │ │ ├── 15-hellotomcat │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── webapp │ │ │ │ │ ├── META-INF │ │ │ │ │ │ └── MANIFEST.mf │ │ │ │ │ └── WEB-INF │ │ │ │ │ │ └── web.xml │ │ │ │ │ └── java │ │ │ │ │ └── HelloServlet.java │ │ │ └── build.gradle │ │ ├── 19-run-arguments │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 34-tomcat-port │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── webapp │ │ │ │ │ ├── META-INF │ │ │ │ │ │ └── MANIFEST.mf │ │ │ │ │ └── WEB-INF │ │ │ │ │ │ └── web.xml │ │ │ │ │ └── java │ │ │ │ │ └── HelloServlet.java │ │ │ └── build.gradle │ │ ├── 37-profile-not-locally │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── Test.java │ │ ├── 43-clean-task │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 45-spring-boot-war │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── webapp │ │ │ │ │ ├── webapp.txt │ │ │ │ │ └── WEB-INF │ │ │ │ │ │ └── custom.properties │ │ │ │ │ └── java │ │ │ │ │ └── sample │ │ │ │ │ └── war │ │ │ │ │ ├── MyController.java │ │ │ │ │ └── SampleWarApplication.java │ │ │ ├── settings.gradle │ │ │ └── build.gradle │ │ ├── 04-excelsior-installer │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ ├── eula.txt │ │ │ │ │ └── icon.ico │ │ │ │ │ └── java │ │ │ │ │ └── HelloSwing.java │ │ │ └── build.gradle │ │ ├── 10-customresources │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── packagefiles │ │ │ │ │ │ ├── custom.file │ │ │ │ │ │ └── subdir │ │ │ │ │ │ └── subdir.file │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 24-windows-service │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── SampleService.java │ │ ├── 26-compactprofiles │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 48-tar-gz-packaging │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 23-invocation-dynamic-library │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloDll.java │ │ │ └── build.gradle │ │ ├── 27-disk-footprint-reduction │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 28-windows-version-info │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 29-runtime-configuration │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 38-multiapp-run-arguments │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 05-excelsior-installer-advanced │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ ├── eula.txt │ │ │ │ │ ├── icon.ico │ │ │ │ │ └── splash.bmp │ │ │ │ │ └── java │ │ │ │ │ └── HelloSwing.java │ │ │ └── build.gradle │ │ ├── 16-with-transitive-dependency │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── AppWithDep.java │ │ ├── 22-with-file-dependencies │ │ │ ├── settings.gradle │ │ │ ├── libs │ │ │ │ ├── single │ │ │ │ │ └── single-dep.jar │ │ │ │ └── multi │ │ │ │ │ ├── first-multi-dep.jar │ │ │ │ │ └── second-multi-dep.jar │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── AppWithFileDeps.java │ │ │ └── build.gradle │ │ ├── 20-run-arguments-via-system-props │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 41-pdbconfiguration-with-base-dir │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 44-spring-boot │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ │ └── java │ │ │ │ │ └── sample │ │ │ │ │ └── tomcat │ │ │ │ │ ├── service │ │ │ │ │ └── HelloWorldService.java │ │ │ │ │ ├── web │ │ │ │ │ └── SampleController.java │ │ │ │ │ └── SampleTomcatApplication.java │ │ │ └── build.gradle │ │ ├── 42-pdbconfiguration-with-specific-location │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 18-nostacktrace-splashfromfile-runtimeclassic │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── splash.png │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 32-excelsior-installer-advanced-11-3-common │ │ │ ├── settings.gradle │ │ │ ├── libuninstall.so │ │ │ ├── uninstall.dll │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ ├── install.dll │ │ │ │ │ └── libinstall.so │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 33-excelsior-installer-advanced-11-3-windows │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ ├── packagefiles │ │ │ │ │ │ ├── README.txt │ │ │ │ │ │ ├── workDir │ │ │ │ │ │ │ └── keep.notempty │ │ │ │ │ │ ├── run.bat │ │ │ │ │ │ └── file.ico │ │ │ │ │ ├── installerImage.bmp │ │ │ │ │ └── uninstallerImage.bmp │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ ├── resources │ │ │ │ ├── big.bmp │ │ │ │ └── readme.ico │ │ │ └── build.gradle │ │ ├── 17-fullstacktrace-splashfrommanifest-chineselocale │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ └── splash.png │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ ├── 40-regression-excelsior-installer-no-shortcut-icon │ │ │ ├── settings.gradle │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── jetresources │ │ │ │ │ └── packagefiles │ │ │ │ │ │ └── README.txt │ │ │ │ │ └── java │ │ │ │ │ └── HelloWorld.java │ │ │ └── build.gradle │ │ └── 25-windows-service-multiapp-with-excelsior-installer │ │ │ ├── settings.gradle │ │ │ ├── build.gradle │ │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── SampleService.java │ └── groovy │ │ └── com │ │ └── excelsiorjet │ │ └── gradle │ │ └── plugin │ │ ├── HelloWorldProject.groovy │ │ ├── JetHomeFunTest.groovy │ │ ├── ProtectDataFunTest.groovy │ │ ├── TrialVersionFunTest.groovy │ │ ├── CleanTaskFunTest.groovy │ │ ├── HelloWorldFunTest.groovy │ │ ├── MultiAppFunTest.groovy │ │ ├── PDBConfigurationWithSpecificLocationFunTest.groovy │ │ ├── TarGzPackagingFunTest.groovy │ │ ├── PDBConfigurationWithBaseDirFunTest.groovy │ │ ├── TimeoutsFunTest.groovy │ │ ├── RuntimeConfigurationFunTest.groovy │ │ ├── CompactProfilesFunTest.groovy │ │ ├── SlimdownFunTest.groovy │ │ ├── OsxAppBundleFunTest.groovy │ │ ├── DiskFootprintReductionFunTest.groovy │ │ ├── InvocationDynamicLibraryFunTest.groovy │ │ ├── WindowsVersionInfoFunTest.groovy │ │ ├── HelloSwingFunTest.groovy │ │ ├── TomcatPortFunTest.groovy │ │ ├── ExcelsiorInstallerFunTest.groovy │ │ ├── MultiAppRunArgsFunTest.groovy │ │ ├── OptRtFilesFunTest.groovy │ │ ├── PGOFunTest.groovy │ │ ├── ExcelsiorInstallerAdvancedFunTest.groovy │ │ ├── JvmArgsFunTest.groovy │ │ ├── PackageFilesFunTest.groovy │ │ ├── TestRunFunTest.groovy │ │ ├── CustomResourcesFunTest.groovy │ │ ├── RunArgsFunTest.groovy │ │ ├── StopTaskFunTest.groovy │ │ ├── RunArgsViaSysPropsFunTest.groovy │ │ ├── AppWithTransDepFunTest.groovy │ │ ├── ProfileNotLocallyFunTest.groovy │ │ ├── AppWithDepFunTest.groovy │ │ ├── NoStackTraceSplashFromFileRuntimeClassicFunTest.groovy │ │ ├── FullStackTraceSplashFromManfiestChineseLocaleFunTest.groovy │ │ ├── RegressionExcelsiorInstallerNoShortcutIconFunTest.groovy │ │ ├── WindowsServiceFunTest.groovy │ │ ├── TomcatFunTest.groovy │ │ ├── WithFileDependenciesTest.groovy │ │ ├── WindowsServiceMultiAppWithExcelsiorInstallerFunTest.groovy │ │ ├── ExcelsiorInstallerAdvanced11_3CommonFunTest.groovy │ │ ├── ExcelsiorInstallerAdvanced11_3WindowsFunTest.groovy │ │ ├── SpringBootWarFunTest.groovy │ │ ├── SpringBootFunTest.groovy │ │ ├── DependencyManagementFunTest.groovy │ │ └── BaseFunTest.groovy └── main │ ├── resources │ ├── META-INF │ │ └── gradle-plugins │ │ │ └── excelsiorJet.properties │ └── com │ │ └── excelsiorjet │ │ └── gradle │ │ └── plugin │ │ └── GradleStrings.properties │ └── groovy │ └── com │ └── excelsiorjet │ └── gradle │ └── plugin │ ├── JetCleanTask.groovy │ ├── JetRunTask.groovy │ ├── JetProfileTask.groovy │ ├── JetStopTask.groovy │ ├── GradleLog.groovy │ ├── JetBuildTask.groovy │ ├── JetTestRunTask.groovy │ ├── AbstractBuildTask.groovy │ └── AbstractJetTask.groovy ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── release.sh ├── test.sh ├── funTests.gradle ├── gradlew.bat ├── maven.gradle └── gradlew /gradle.properties: -------------------------------------------------------------------------------- 1 | version=1.3.4-SNAPSHOT 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .gradletasknamecache 3 | build 4 | -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/extDir/test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/extDir2/test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/36-pgo/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Test' -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'excelsior-jet-gradle-plugin' 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/12-jvmargs/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'JVMArgs' -------------------------------------------------------------------------------- /src/test/resources/31-package-files/packagefiles/custom.file: -------------------------------------------------------------------------------- 1 | Custom file -------------------------------------------------------------------------------- /src/test/resources/46-stop-task/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'App' -------------------------------------------------------------------------------- /src/test/resources/47-timeouts/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'App' -------------------------------------------------------------------------------- /src/test/resources/06-multiapp/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/07-testrun/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/09-slimdown/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/39-jethome/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/01-helloworld/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/02-withdependency/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AppWithDep' -------------------------------------------------------------------------------- /src/test/resources/03-helloswing/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloSwing' -------------------------------------------------------------------------------- /src/test/resources/08-optrtfiles/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/11-trialversion/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/13-protectdata/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/14-osx-app-bundle/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloSwing' -------------------------------------------------------------------------------- /src/test/resources/15-hellotomcat/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloTomcat' -------------------------------------------------------------------------------- /src/test/resources/19-run-arguments/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/31-package-files/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/34-tomcat-port/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloTomcat' -------------------------------------------------------------------------------- /src/test/resources/37-profile-not-locally/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'Test' -------------------------------------------------------------------------------- /src/test/resources/43-clean-task/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/src/main/webapp/webapp.txt: -------------------------------------------------------------------------------- 1 | Hello WebApp 2 | -------------------------------------------------------------------------------- /src/test/resources/04-excelsior-installer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloSwing' -------------------------------------------------------------------------------- /src/test/resources/07-testrun/src/main/jetresources/packagefiles/custom.file: -------------------------------------------------------------------------------- 1 | Custom file -------------------------------------------------------------------------------- /src/test/resources/10-customresources/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/24-windows-service/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SampleService' -------------------------------------------------------------------------------- /src/test/resources/26-compactprofiles/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/48-tar-gz-packaging/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/04-excelsior-installer/src/main/jetresources/eula.txt: -------------------------------------------------------------------------------- 1 | This is a sample EULA -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AppWithDep' -------------------------------------------------------------------------------- /src/test/resources/23-invocation-dynamic-library/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloDll' -------------------------------------------------------------------------------- /src/test/resources/27-disk-footprint-reduction/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/28-windows-version-info/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/29-runtime-configuration/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/38-multiapp-run-arguments/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloSwing' -------------------------------------------------------------------------------- /src/test/resources/10-customresources/src/main/jetresources/packagefiles/custom.file: -------------------------------------------------------------------------------- 1 | Custom file -------------------------------------------------------------------------------- /src/test/resources/16-with-transitive-dependency/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AppWithDep' -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'AppWithFileDeps' -------------------------------------------------------------------------------- /src/test/resources/31-package-files/packagefiles/subdir/subdir.file: -------------------------------------------------------------------------------- 1 | Custom file in a subdirectory -------------------------------------------------------------------------------- /src/test/resources/20-run-arguments-via-system-props/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/41-pdbconfiguration-with-base-dir/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-boot-sample-tomcat' 2 | -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'spring-boot-sample-war' 2 | -------------------------------------------------------------------------------- /src/test/resources/42-pdbconfiguration-with-specific-location/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/src/main/webapp/WEB-INF/custom.properties: -------------------------------------------------------------------------------- 1 | demo.string.value=demo 2 | -------------------------------------------------------------------------------- /src/test/resources/07-testrun/src/main/jetresources/packagefiles/subdir/subdir.file: -------------------------------------------------------------------------------- 1 | Custom file in a subdirectory -------------------------------------------------------------------------------- /src/test/resources/18-nostacktrace-splashfromfile-runtimeclassic/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/17-fullstacktrace-splashfrommanifest-chineselocale/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/40-regression-excelsior-installer-no-shortcut-icon/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'HelloWorld' -------------------------------------------------------------------------------- /src/test/resources/10-customresources/src/main/jetresources/packagefiles/subdir/subdir.file: -------------------------------------------------------------------------------- 1 | Custom file in a subdirectory -------------------------------------------------------------------------------- /src/test/resources/25-windows-service-multiapp-with-excelsior-installer/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'SampleService' -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/packagefiles/README.txt: -------------------------------------------------------------------------------- 1 | README first -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/packagefiles/workDir/keep.notempty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/resources/40-regression-excelsior-installer-no-shortcut-icon/src/main/jetresources/packagefiles/README.txt: -------------------------------------------------------------------------------- 1 | README first -------------------------------------------------------------------------------- /src/main/resources/META-INF/gradle-plugins/excelsiorJet.properties: -------------------------------------------------------------------------------- 1 | implementation-class=com.excelsiorjet.gradle.plugin.ExcelsiorJetPlugin -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Performs release of current version into maven central 3 | ./gradlew -x test clean release closeAndPromoteRepository -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/packagefiles/run.bat: -------------------------------------------------------------------------------- 1 | ..\HelloWorld.exe from run.bat %1 >runout.txt 2>&1 -------------------------------------------------------------------------------- /src/test/resources/15-hellotomcat/src/main/webapp/META-INF/MANIFEST.mf: -------------------------------------------------------------------------------- 1 | 2 | $\{project.artifactId}-$\{project.version}-r$\{buildNumber} 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/34-tomcat-port/src/main/webapp/META-INF/MANIFEST.mf: -------------------------------------------------------------------------------- 1 | 2 | $\{project.artifactId}-$\{project.version}-r$\{buildNumber} 3 | 4 | -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.compression.enabled: true 2 | server.compression.min-response-size: 1 3 | server.connection-timeout=5000 4 | -------------------------------------------------------------------------------- /src/test/resources/03-helloswing/src/main/jetresources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/03-helloswing/src/main/jetresources/icon.ico -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/lib/junit-4.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/21-dependencymanagement/lib/junit-4.8.2.jar -------------------------------------------------------------------------------- /src/test/resources/06-multiapp/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/07-testrun/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/09-slimdown/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/06-multiapp/src/main/java/HelloWorld2.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld2 { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World2"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/08-optrtfiles/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/11-trialversion/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/13-protectdata/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/14-osx-app-bundle/src/main/jetresources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/14-osx-app-bundle/src/main/jetresources/icon.icns -------------------------------------------------------------------------------- /src/test/resources/31-package-files/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/39-jethome/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/01-helloworld/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/10-customresources/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/43-clean-task/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/04-excelsior-installer/src/main/jetresources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/04-excelsior-installer/src/main/jetresources/icon.ico -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/lib/google-collections-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/21-dependencymanagement/lib/google-collections-1.0.jar -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/libs/single/single-dep.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/22-with-file-dependencies/libs/single/single-dep.jar -------------------------------------------------------------------------------- /src/test/resources/26-compactprofiles/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/27-disk-footprint-reduction/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } -------------------------------------------------------------------------------- /src/test/resources/48-tar-gz-packaging/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/libs/multi/first-multi-dep.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/22-with-file-dependencies/libs/multi/first-multi-dep.jar -------------------------------------------------------------------------------- /src/test/resources/28-windows-version-info/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/29-runtime-configuration/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/libs/multi/second-multi-dep.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/22-with-file-dependencies/libs/multi/second-multi-dep.jar -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/libuninstall.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/32-excelsior-installer-advanced-11-3-common/libuninstall.so -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/uninstall.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/32-excelsior-installer-advanced-11-3-common/uninstall.dll -------------------------------------------------------------------------------- /src/test/resources/41-pdbconfiguration-with-base-dir/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/eula.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/eula.txt -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/icon.ico -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/splash.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/05-excelsior-installer-advanced/src/main/jetresources/splash.bmp -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/resources/big.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/33-excelsior-installer-advanced-11-3-windows/resources/big.bmp -------------------------------------------------------------------------------- /src/test/resources/42-pdbconfiguration-with-specific-location/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | System.out.println("Hello World"); 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/resources/readme.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/33-excelsior-installer-advanced-11-3-windows/resources/readme.ico -------------------------------------------------------------------------------- /src/test/resources/18-nostacktrace-splashfromfile-runtimeclassic/src/main/jetresources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/18-nostacktrace-splashfromfile-runtimeclassic/src/main/jetresources/splash.png -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/src/main/jetresources/install.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/32-excelsior-installer-advanced-11-3-common/src/main/jetresources/install.dll -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/src/main/jetresources/libinstall.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/32-excelsior-installer-advanced-11-3-common/src/main/jetresources/libinstall.so -------------------------------------------------------------------------------- /src/test/resources/17-fullstacktrace-splashfrommanifest-chineselocale/src/main/resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/17-fullstacktrace-splashfrommanifest-chineselocale/src/main/resources/splash.png -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/installerImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/installerImage.bmp -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/packagefiles/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/packagefiles/file.ico -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/uninstallerImage.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excelsior-oss/excelsior-jet-gradle-plugin/HEAD/src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/jetresources/uninstallerImage.bmp -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 28 12:05:20 NOVT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip 7 | -------------------------------------------------------------------------------- /src/test/resources/23-invocation-dynamic-library/src/main/java/HelloDll.java: -------------------------------------------------------------------------------- 1 | public class HelloDll { 2 | 3 | public static void dllEntryPoint() { 4 | System.out.println("Hello Dll"); 5 | } 6 | 7 | public static void main(String args[]) { 8 | dllEntryPoint(); 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/HelloWorldProject.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | trait HelloWorldProject { 4 | 5 | public String projectName() { 6 | return "HelloWorld" 7 | } 8 | 9 | public String projectVersion() { 10 | return "1.0-SNAPSHOT" 11 | } 12 | } -------------------------------------------------------------------------------- /src/test/resources/18-nostacktrace-splashfromfile-runtimeclassic/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | if (!new Exception().getStackTrace()[0].getClassName().equals("Unknown")) 5 | throw new Error("Stack trace is here"); 6 | System.out.println("Hello World"); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/17-fullstacktrace-splashfrommanifest-chineselocale/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | if (new Exception().getStackTrace()[0].getLineNumber() < 0) 5 | throw new Error("No line numbers in stack trace"); 6 | System.out.println("Hello World"); 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /src/test/resources/47-timeouts/src/main/java/App.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class App { 4 | 5 | private static void failed() throws Exception { 6 | new File("failed").createNewFile(); 7 | System.exit(10); 8 | } 9 | 10 | public static void main(String args[]) throws Exception { 11 | Thread.sleep(10000); 12 | failed(); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/02-withdependency/src/main/java/AppWithDep.java: -------------------------------------------------------------------------------- 1 | import org.apache.commons.io.IOUtils; 2 | 3 | import java.io.IOException; 4 | import java.io.StringReader; 5 | import java.lang.System; 6 | 7 | public class AppWithDep { 8 | 9 | public static void main(String args[]) throws IOException { 10 | System.out.println(IOUtils.toString(new StringReader("HelloWorld"))); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/test/resources/12-jvmargs/src/main/java/JVMArgs.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | import java.io.IOException; 3 | import java.nio.file.Files; 4 | import java.util.Collections; 5 | 6 | public class JVMArgs { 7 | 8 | public static void main(String args[]) throws IOException { 9 | String jvmArg = System.getProperty("jetrt.location"); 10 | Files.write(new File("run.out").toPath(), Collections.singletonList(jvmArg)); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /src/test/resources/36-pgo/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "Test" 17 | } -------------------------------------------------------------------------------- /src/test/resources/01-helloworld/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "HelloWorld" 17 | } -------------------------------------------------------------------------------- /src/test/resources/38-multiapp-run-arguments/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | 3 | public static void main(String args[]) { 4 | for (int i = 0; i < args.length; i++) { 5 | String arg = args[i]; 6 | System.out.println(i + ": " + arg); 7 | 8 | } 9 | if (args.length == 0) { 10 | System.out.println("No arguments specified"); 11 | System.exit(3); 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/39-jethome/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "HelloWorld" 17 | jetHome = "jetHome" 18 | } -------------------------------------------------------------------------------- /src/test/resources/48-tar-gz-packaging/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "HelloWorld" 17 | packaging = 'tar-gz' 18 | } -------------------------------------------------------------------------------- /src/test/resources/19-run-arguments/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String args[]) { 6 | for (int i = 0; i < args.length; i++) { 7 | String arg = args[i]; 8 | System.out.println(i + ": " + arg); 9 | 10 | } 11 | if (args.length == 0) { 12 | System.out.println("No arguments specified"); 13 | System.exit(3); 14 | } 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/src/main/java/AppWithDep.java: -------------------------------------------------------------------------------- 1 | import org.apache.commons.io.IOUtils; 2 | 3 | import java.io.IOException; 4 | import java.io.StringReader; 5 | import java.lang.System; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | public class AppWithDep { 9 | 10 | public static void main(String args[]) throws IOException { 11 | System.out.println(IOUtils.toString(new StringReader("HelloWorld"))); 12 | org.junit.Assert.assertTrue(true); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/20-run-arguments-via-system-props/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String args[]) { 6 | for (int i = 0; i < args.length; i++) { 7 | String arg = args[i]; 8 | System.out.println(i + ": " + arg); 9 | 10 | } 11 | if (args.length == 0) { 12 | System.out.println("No arguments specified"); 13 | System.exit(3); 14 | } 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/10-customresources/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/37-profile-not-locally/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "Test" 17 | execProfiles { 18 | profileLocally = false 19 | } 20 | } -------------------------------------------------------------------------------- /src/test/resources/20-run-arguments-via-system-props/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | } -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String args[]) throws IOException { 6 | try (PrintWriter out = new PrintWriter(new OutputStreamWriter( 7 | new FileOutputStream("out.txt")))) { 8 | for (int i = 0; i < args.length; i++) { 9 | String arg = args[i]; 10 | out.println(i + ": " + arg); 11 | } 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String args[]) throws IOException { 6 | try (PrintWriter out = new PrintWriter(new OutputStreamWriter( 7 | new FileOutputStream("out.txt")))) { 8 | for (int i = 0; i < args.length; i++) { 9 | String arg = args[i]; 10 | out.println(i + ": " + arg); 11 | } 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/40-regression-excelsior-installer-no-shortcut-icon/src/main/java/HelloWorld.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class HelloWorld { 4 | 5 | public static void main(String args[]) throws IOException { 6 | try (PrintWriter out = new PrintWriter(new OutputStreamWriter( 7 | new FileOutputStream("out.txt")))) { 8 | for (int i = 0; i < args.length; i++) { 9 | String arg = args[i]; 10 | out.println(i + ": " + arg); 11 | } 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /src/test/resources/06-multiapp/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | multiApp = true 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources/43-clean-task/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | 15 | apply plugin: 'excelsiorJet' 16 | excelsiorJet { 17 | mainClass = "HelloWorld" 18 | pdb { 19 | keepInBuildDir = true 20 | } 21 | } -------------------------------------------------------------------------------- /src/test/resources/15-hellotomcat/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | hello 7 | 8 | HelloServlet 9 | HelloServlet 10 | 11 | 12 | 13 | HelloServlet 14 | / 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/19-run-arguments/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | runArgs = ["arg1", "arg2.1, arg2.2"] 20 | } -------------------------------------------------------------------------------- /src/test/resources/34-tomcat-port/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | hello 7 | 8 | HelloServlet 9 | HelloServlet 10 | 11 | 12 | 13 | HelloServlet 14 | / 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/14-osx-app-bundle/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | version = "1.0-SNAPSHOT" 14 | 15 | apply plugin: 'excelsiorJet' 16 | excelsiorJet { 17 | mainClass 'com.excelsior.HelloSwing' 18 | profileStartup false 19 | packaging 'osx-app-bundle' 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources/23-invocation-dynamic-library/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | appType = 'dynamic-library' 19 | packaging = 'none' 20 | } 21 | -------------------------------------------------------------------------------- /src/test/resources/07-testrun/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | pdb { 20 | keepInBuildDir = true 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/08-optrtfiles/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | runtime { 20 | components = ['javafx-webkit', 'nashorn'] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/03-helloswing/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloSwing' 19 | hideConsole = true 20 | pdb { 21 | keepInBuildDir = true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/03-helloswing/src/main/java/HelloSwing.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.event.*; 3 | 4 | public class HelloSwing { 5 | 6 | public static void main(String args[]) { 7 | JFrame frame = new JFrame("HelloSwing"); 8 | frame.setSize(50, 50); 9 | JLabel label = new JLabel("Hello, Swing!", 0); 10 | frame.add(label); 11 | frame.addWindowListener(new WindowAdapter() { 12 | public void windowClosing(WindowEvent windowevent) { 13 | System.exit(0); 14 | } 15 | }); 16 | frame.show(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/13-protectdata/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | protectData true 20 | pdb { 21 | keepInBuildDir = true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/26-compactprofiles/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | runtime { 20 | profile = "compact3" 21 | } 22 | packaging = "none" 23 | } -------------------------------------------------------------------------------- /src/test/resources/04-excelsior-installer/src/main/java/HelloSwing.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.event.*; 3 | 4 | public class HelloSwing { 5 | 6 | public static void main(String args[]) { 7 | JFrame frame = new JFrame("HelloSwing"); 8 | frame.setSize(50, 50); 9 | JLabel label = new JLabel("Hello, Swing!", 0); 10 | frame.add(label); 11 | frame.addWindowListener(new WindowAdapter() { 12 | public void windowClosing(WindowEvent windowevent) { 13 | System.exit(0); 14 | } 15 | }); 16 | frame.show(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/12-jvmargs/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass 'JVMArgs' 19 | profileStartup false 20 | packaging 'none' 21 | 22 | jvmArgs = ['-Djetrt.location=$(Root)/rt'] 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/src/main/java/HelloSwing.java: -------------------------------------------------------------------------------- 1 | import javax.swing.*; 2 | import java.awt.event.*; 3 | 4 | public class HelloSwing { 5 | 6 | public static void main(String args[]) { 7 | JFrame frame = new JFrame("HelloSwing"); 8 | frame.setSize(50, 50); 9 | JLabel label = new JLabel("Hello, Swing!", 0); 10 | frame.add(label); 11 | frame.addWindowListener(new WindowAdapter() { 12 | public void windowClosing(WindowEvent windowevent) { 13 | System.exit(0); 14 | } 15 | }); 16 | frame.show(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/test/resources/04-excelsior-installer/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.2.3-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloSwing' 19 | hideConsole = true 20 | packaging = 'excelsior-installer' 21 | profileStartup = false 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/09-slimdown/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | runtime { 20 | slimDown { 21 | detachedBaseURL = 'file://' 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/27-disk-footprint-reduction/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | globalOptimizer = true 20 | runtime { 21 | diskFootprintReduction = 'high-disk' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/41-pdbconfiguration-with-base-dir/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | 15 | apply plugin: 'excelsiorJet' 16 | excelsiorJet { 17 | mainClass = "HelloWorld" 18 | pdb { 19 | baseDir = new File(System.getProperty("user.home"), ".ExcelsiorJET" + File.separator + "TestPDBBaseDir") 20 | } 21 | } -------------------------------------------------------------------------------- /src/test/resources/38-multiapp-run-arguments/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | packaging = "none" 20 | multiApp = true 21 | multiAppRunArgs = ["-Dnoop", "-args", "arg1", "arg2.1, arg2.2"] 22 | } -------------------------------------------------------------------------------- /src/test/resources/14-osx-app-bundle/src/main/java/com/excelsior/HelloSwing.java: -------------------------------------------------------------------------------- 1 | package com.excelsior; 2 | 3 | import javax.swing.*; 4 | import java.awt.event.*; 5 | 6 | public class HelloSwing { 7 | 8 | public static void main(String args[]) { 9 | JFrame frame = new JFrame("HelloSwing"); 10 | frame.setSize(50, 50); 11 | JLabel label = new JLabel("Hello, Swing!", 0); 12 | frame.add(label); 13 | frame.addWindowListener(new WindowAdapter() { 14 | public void windowClosing(WindowEvent windowevent) { 15 | System.exit(0); 16 | } 17 | }); 18 | frame.show(); 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/test/resources/42-pdbconfiguration-with-specific-location/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | 15 | apply plugin: 'excelsiorJet' 16 | excelsiorJet { 17 | mainClass = "HelloWorld" 18 | pdb { 19 | specificLocation = new File(System.getProperty("user.home"), ".ExcelsiorJET" + File.separator + "TestPDB") 20 | } 21 | } -------------------------------------------------------------------------------- /src/test/resources/47-timeouts/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "App" 17 | packaging = "none" 18 | profileStartup = false 19 | execProfiles { 20 | testRunTimeout = 5 21 | profileRunTimeout = 5 22 | } 23 | } 24 | 25 | repositories { 26 | mavenCentral() 27 | } 28 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetCleanTask.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import com.excelsiorjet.api.ExcelsiorJet 4 | import com.excelsiorjet.api.tasks.JetProject 5 | import org.gradle.api.tasks.TaskAction 6 | 7 | /** 8 | * Cleans up Excelsior JET Project database (PDB) directory for the current project. 9 | */ 10 | class JetCleanTask extends AbstractBuildTask { 11 | 12 | @TaskAction 13 | def jetClean() { 14 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 15 | JetProject jetProject = createJetProject() 16 | new com.excelsiorjet.api.tasks.JetCleanTask(jetProject, excelsiorJet).execute() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/29-runtime-configuration/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | packaging = "none" 20 | runtime { 21 | flavor = "classic" 22 | location = "hidden/runtime" 23 | } 24 | pdb { 25 | keepInBuildDir = true 26 | } 27 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/JetHomeFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.UnexpectedBuildFailure 4 | 5 | class JetHomeFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "jetHome plugin property checking"() { 8 | when: 9 | runGradle('jetBuild') 10 | 11 | then: 12 | UnexpectedBuildFailure ex = thrown() 13 | ex.getMessage().contains("com.excelsiorjet.api.JetHomeException: The jetHome plugin parameter points to \"jetHome\", which is not an Excelsior JET installation directory.") 14 | 15 | } 16 | 17 | public String testProjectDir() { 18 | return "39-jethome" 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/02-withdependency/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "AppWithDep" 19 | pdb { 20 | keepInBuildDir = true 21 | } 22 | } 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | dependencies { 29 | compile "org.apache.commons:commons-io:1.3.2" 30 | } 31 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ProtectDataFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class ProtectDataFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | @IgnoreIf({!dataProtectionSupported}) 8 | def "test protect data configuration"() { 9 | when: 10 | def cryptseed = new File(basedir, "build/jet/build/HelloWorld_jetpdb/cryptseed") 11 | runGradle("clean", "jetBuild") 12 | 13 | then: 14 | appExeFile.exists() 15 | !appExeFile.text.contains("") 16 | cryptseed.exists() 17 | } 18 | 19 | @Override 20 | protected String testProjectDir() { 21 | return "13-protectdata" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/test/resources/05-excelsior-installer-advanced/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.2.3-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloSwing' 19 | hideConsole = true 20 | packaging = 'excelsior-installer' 21 | profileStartup = false 22 | excelsiorInstaller { 23 | installerSplash = file('src/main/jetresources/splash.bmp') 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/16-with-transitive-dependency/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "AppWithDep" 19 | pdb { 20 | keepInBuildDir = true 21 | } 22 | } 23 | 24 | repositories { 25 | mavenCentral() 26 | } 27 | 28 | dependencies { 29 | compile 'com.fasterxml.jackson.core:jackson-databind:2.8.0' 30 | } 31 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TrialVersionFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class TrialVersionFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | @IgnoreIf({!trialSupported}) 8 | def "test trial version configuration"() { 9 | when: 10 | runGradle("clean", "jetBuild") 11 | 12 | then: 13 | new File(basedir, "build/jet/build/HelloWorld_jetpdb/HelloWorld.rsp").text.contains("expire") 14 | 15 | appExeFile.exists() 16 | 17 | crossCompilation || cmdOutput(appExeFile).contains("App is expired") 18 | } 19 | 20 | @Override 21 | protected String testProjectDir() { 22 | return "11-trialversion" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/11-trialversion/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass 'HelloWorld' 19 | packaging 'excelsior-installer' 20 | profileStartup false 21 | 22 | trialVersion { 23 | expireDate = '01Jun2001' 24 | expireMessage = 'App is expired' 25 | } 26 | pdb { 27 | keepInBuildDir = true 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/src/main/java/AppWithFileDeps.java: -------------------------------------------------------------------------------- 1 | import org.apache.commons.io.IOUtils; 2 | import com.example.single.SingleDep; 3 | import com.example.multi.first.FirstMultiDep; 4 | import com.example.multi.second.SecondMultiDep; 5 | 6 | import java.io.IOException; 7 | import java.io.StringReader; 8 | import java.lang.System; 9 | 10 | public class AppWithFileDeps { 11 | 12 | public static void main(String args[]) throws IOException { 13 | System.out.println(IOUtils.toString(new StringReader("HelloWorld")) 14 | + 15 | ":" + SingleDep.getName() 16 | + 17 | ":" + FirstMultiDep.getName() 18 | + 19 | ":" + SecondMultiDep.getName() 20 | ); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/CleanTaskFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class CleanTaskFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | def "perform jetClean task"() { 9 | when: 10 | def pdbDir = new File(basedir, "target/jet/build/HelloWorld_jetpdb") 11 | def result = runGradle('jetBuild', 'jetClean') 12 | 13 | then: 14 | appExeFile.exists() 15 | !pdbDir.exists() 16 | 17 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 18 | result.task(":jetClean").outcome == TaskOutcome.SUCCESS 19 | } 20 | 21 | public String testProjectDir() { 22 | return "43-clean-task" 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/28-windows-version-info/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "HelloWorld" 19 | windowsVersionInfo { 20 | company = "MyCompany" 21 | product = "MyProduct" 22 | version = "4.3.2.1" 23 | copyright = "MyCopyright" 24 | description = "My description" 25 | } 26 | pdb { 27 | keepInBuildDir = true 28 | } 29 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/HelloWorldFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class HelloWorldFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "jetBuild task builds simple application"() { 8 | when: 9 | def zipFile = new File(basedir, "build/jet/${projectName()}" + ".zip") 10 | def result = runGradle('jetBuild') 11 | 12 | then: 13 | buildExeFile.exists() 14 | appExeFile.exists() 15 | zipFile.exists() 16 | 17 | checkStdOutContains("Hello World", appExeFile) 18 | 19 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 20 | } 21 | 22 | public String testProjectDir() { 23 | return "01-helloworld" 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/31-package-files/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | packageFiles { 20 | file { 21 | path = new File(project.projectDir, "packagefiles/custom.file") 22 | packagePath = "/customfiles" 23 | } 24 | folder { 25 | path = new File(project.projectDir, "packagefiles/subdir") 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/test/resources/34-tomcat-port/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "war" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | optimizationPreset = "smart" 19 | tomcat { 20 | warDeployName = "ROOT" 21 | allowUserToChangeTomcatPort = true 22 | } 23 | packaging = "excelsior-installer" 24 | } 25 | 26 | repositories { 27 | mavenCentral() 28 | } 29 | 30 | dependencies { 31 | compileOnly "javax.servlet:javax.servlet-api:3.0.1" 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/18-nostacktrace-splashfromfile-runtimeclassic/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | packaging = "none" 19 | mainClass = "HelloWorld" 20 | stackTraceSupport = "none" 21 | inlineExpansion = "tiny-methods-only" 22 | compilerOptions = ["-jetrt=CLASSIC"] 23 | pdb { 24 | keepInBuildDir = true 25 | } 26 | } 27 | 28 | repositories { 29 | mavenCentral() 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/MultiAppFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class MultiAppFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!multiAppSupported}) 9 | def "jetBuild task builds simple multiapp application"() { 10 | when: 11 | def result = runGradle('jetBuild') 12 | 13 | then: 14 | appExeFile.exists() 15 | 16 | checkStdOutContains("Hello World", appExeFile) 17 | checkStdOutContains("Hello World2", appExeFile, "HelloWorld2") 18 | 19 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 20 | } 21 | 22 | @Override 23 | protected String testProjectDir() { 24 | return "06-multiapp" 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/resources/16-with-transitive-dependency/src/main/java/AppWithDep.java: -------------------------------------------------------------------------------- 1 | import com.fasterxml.jackson.databind.ObjectMapper; 2 | import java.io.IOException; 3 | 4 | public class AppWithDep { 5 | 6 | public static void main(String args[]) throws IOException { 7 | System.out.println(new ObjectMapper().writeValueAsString(new Obj("field1", "field2"))); 8 | } 9 | 10 | private static class Obj { 11 | 12 | private final String field1; 13 | 14 | private final String field2; 15 | 16 | public Obj(String field1, String field2) { 17 | this.field1 = field1; 18 | this.field2 = field2; 19 | } 20 | 21 | public String getField1() { 22 | return field1; 23 | } 24 | 25 | public String getField2() { 26 | return field2; 27 | } 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/PDBConfigurationWithSpecificLocationFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class PDBConfigurationWithSpecificLocationFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!smartSupported}) 9 | def "configure PDB with specificLocation"() { 10 | when: 11 | def pdbDir = new File(System.getProperty("user.home"), ".ExcelsiorJET" + File.separator + "TestPDB") 12 | def result = runGradle('jetBuild') 13 | 14 | then: 15 | pdbDir.exists() 16 | 17 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 18 | } 19 | 20 | public String testProjectDir() { 21 | return "42-pdbconfiguration-with-specific-location" 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/46-stop-task/src/main/java/App.java: -------------------------------------------------------------------------------- 1 | import com.excelsiorjet.api.cmd.*; 2 | import com.excelsiorjet.api.log.*; 3 | import java.io.*; 4 | 5 | public class App { 6 | 7 | private static void failed() throws Exception { 8 | new File("failed").createNewFile(); 9 | System.exit(10); 10 | } 11 | 12 | public static void main(String args[]) throws Exception { 13 | File workingDirectory = new File("../../.."); 14 | try { 15 | // stop application using Gradle. 16 | if (new CmdLineTool(args).workingDirectory(workingDirectory).withLog(new StdOutLog()).execute() != 0) { 17 | failed(); 18 | } 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | failed(); 22 | } 23 | Thread.sleep(5000); 24 | failed(); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TarGzPackagingFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class TarGzPackagingFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!tarGzPackagingSupported}) 9 | def "jetBuild task packs to tar.gz"() { 10 | when: 11 | def archiveFile = new File(basedir, "build/jet/${projectName()}" + ".tar.gz") 12 | def result = runGradle('jetBuild') 13 | 14 | then: 15 | buildExeFile.exists() 16 | appExeFile.exists() 17 | archiveFile.exists() 18 | 19 | checkStdOutContains("Hello World", appExeFile) 20 | 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | public String testProjectDir() { 25 | return "48-tar-gz-packaging" 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/PDBConfigurationWithBaseDirFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class PDBConfigurationWithBaseDirFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!smartSupported}) 9 | def "configure PDB with baseDir"() { 10 | when: 11 | def pdbDir = new File(System.getProperty("user.home"), ".ExcelsiorJET" + File.separator + "TestPDBBaseDir" + 12 | File.separator + "com.excelsior.it" + File.separator + "HelloWorld") 13 | def result = runGradle('jetBuild') 14 | 15 | then: 16 | pdbDir.exists() 17 | 18 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 19 | } 20 | 21 | public String testProjectDir() { 22 | return "41-pdbconfiguration-with-base-dir" 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TimeoutsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class TimeoutsFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({crossCompilation || !PGOSupported}) 9 | def "tests test run, profile timeouts"() { 10 | setup: 11 | 12 | when: 13 | def result = runGradle("jetTestRun", "jetProfile") 14 | 15 | then: 16 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 17 | result.task(":jetProfile").outcome == TaskOutcome.SUCCESS 18 | !(new File(basedir, "build/jet/build/failed").exists()) 19 | !(new File(basedir, "build/jet/appToPofile/failed").exists()) 20 | } 21 | 22 | @Override 23 | protected String testProjectDir() { 24 | return "47-timeouts" 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export JAVA_HOME=/usr/java/jdk1.8.0_25 3 | home=/home/user 4 | tests[0]="${home}/jet11.0-std-x86;notomcat" 5 | tests[1]="${home}/jet11.0-pro-x86;notomcat" 6 | tests[2]="${home}/jet11.0-ent-x86;${home}/apache-tomcat-6.0.18" 7 | tests[3]="${home}/jet11.0-pro-amd64;notomcat" 8 | tests[4]="${home}/jet11.0-ent-amd64;${home}/apache-tomcat-7.0.62" 9 | tests[5]="${home}/jet11.3-ent-amd64;${home}/apache-tomcat-8.0.26" 10 | tests[6]="${home}/jet11.3-pro-amd64;notomcat" 11 | tests[7]="${home}/jet11.3-ent-x86;${home}/apache-tomcat-6.0.18" 12 | tests[8]="${home}/jet11.3-pro-x86;notomcat" 13 | tests[9]="${home}/jet11.3-std-x86;notomcat" 14 | tests[10]="${home}/jet11.3-eval-amd64;${home}/apache-tomcat-8.0.26" 15 | 16 | for t in ${tests[*]}; 17 | do 18 | test=(${t//;/ }) 19 | echo Testing Excelsior JET - ${test[0]} with Tomcat - ${test[1]} 20 | ./gradlew clean build -Djet.home=${test[0]} -Dtomcat.home=${test[1]} 21 | done 22 | -------------------------------------------------------------------------------- /src/test/resources/46-stop-task/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | 14 | apply plugin: 'excelsiorJet' 15 | excelsiorJet { 16 | mainClass = "App" 17 | packaging = "none" 18 | profileStartup = false 19 | terminationPolicy = Random.newInstance().nextBoolean() ? "halt" : "ctrl-c" 20 | optimizationPreset = "smart" 21 | runArgs = [System.getProperty("gradle.exec"), "jetStop", 22 | "-DexcelsiorJetPluginVersion=" + System.getProperty("excelsiorJetPluginVersion")] 23 | } 24 | 25 | repositories { 26 | mavenCentral() 27 | } 28 | 29 | dependencies { 30 | compile "com.excelsiorjet:excelsior-jet-api:1.2.0" 31 | } 32 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/RuntimeConfigurationFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | @IgnoreIf({!changeRTLocationAvailable}) 7 | class RuntimeConfigurationFunTest extends BaseFunTest implements HelloWorldProject { 8 | 9 | def "runtime kind and location test"() { 10 | setup: 11 | def rspFile = new File(basedir, "build/jet/build/HelloWorld_jetpdb/HelloWorld.rsp"); 12 | def relocatedRT = new File( basedir, "build/jet/app/hidden/runtime") 13 | 14 | when: 15 | def result = runGradle('jetBuild') 16 | 17 | then: 18 | 19 | rspFile.text.contains("RuntimeKind:CLASSIC") 20 | relocatedRT.exists() 21 | 22 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 23 | } 24 | 25 | public String testProjectDir() { 26 | return "29-runtime-configuration" 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/24-windows-service/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | appType = "windows-service" 19 | mainClass = "SampleService" 20 | windowsService { 21 | displayName = "Sample Service" 22 | description = "Sample Service created with Excelsior JET" 23 | arguments = ["arg", "arg with space"] 24 | dependencies = ["Dhcp", "Dnscache"] 25 | } 26 | } 27 | 28 | repositories { 29 | mavenCentral() 30 | } 31 | 32 | dependencies { 33 | compileOnly "com.excelsiorjet:excelsior-jet-winservice-api:1.0.0" 34 | } 35 | -------------------------------------------------------------------------------- /src/test/resources/36-pgo/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Test { 4 | 5 | public static class ColdClass { 6 | 7 | static String result; 8 | 9 | public static void foo() { 10 | result = String.format("0x%08x", new Object[] {Integer.valueOf(2)}); 11 | } 12 | 13 | } 14 | 15 | public static void hotCode() { 16 | //warm-up 17 | for (int i = 0; i < 10000; i++) { 18 | String.format("0x%08x", new Object[] {Integer.valueOf(i)}); 19 | } 20 | 21 | long start = System.currentTimeMillis(); 22 | 23 | for (int i = 10000000; i < 10300000; i++) { 24 | new Formatter().format("0x%08x", new Object[] {Integer.valueOf(i)}).toString(); 25 | } 26 | 27 | System.out.println("Time: " + (System.currentTimeMillis() - start)); 28 | } 29 | 30 | public static void main(String[] args) { 31 | ColdClass.foo(); 32 | hotCode(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/CompactProfilesFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class CompactProfilesFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!compactProfilesSupported}) 9 | def "jetBuild task builds simple application packaging with compact3 profile"() { 10 | when: 11 | def libManagement = new File(basedir, "build/jet/app/rt/lib/management") 12 | def libFonts = new File(basedir, "build/jet/app/rt/lib/fonts") 13 | def result = runGradle('jetBuild') 14 | 15 | then: 16 | buildExeFile.exists() 17 | appExeFile.exists() 18 | libManagement.exists() 19 | !libFonts.exists() 20 | 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | public String testProjectDir() { 25 | return "26-compactprofiles" 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/SlimdownFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class SlimdownFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!slimDownSupported}) 9 | def "test java runtime slimdown"() { 10 | setup: 11 | File rt0Jar = new File(basedir, "build/jet/app/rt/lib/rt-0.jar") 12 | 13 | when: 14 | def result = runGradle('clean', 'jetTestRun', 'jetBuild') 15 | 16 | then: 17 | rt0Jar.exists() 18 | 19 | result.task(":clean").outcome == TaskOutcome.SUCCESS || result.task(":clean").outcome == TaskOutcome.UP_TO_DATE 20 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | @Override 25 | protected String testProjectDir() { 26 | return "09-slimdown" 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/37-profile-not-locally/src/main/java/Test.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Test { 4 | 5 | public static class ColdClass { 6 | 7 | static String result; 8 | 9 | public static void foo() { 10 | result = String.format("0x%08x", new Object[] {Integer.valueOf(2)}); 11 | } 12 | 13 | } 14 | 15 | public static void hotCode() { 16 | //warm-up 17 | for (int i = 0; i < 10000; i++) { 18 | String.format("0x%08x", new Object[] {Integer.valueOf(i)}); 19 | } 20 | 21 | long start = System.currentTimeMillis(); 22 | 23 | for (int i = 10000000; i < 10300000; i++) { 24 | new Formatter().format("0x%08x", new Object[] {Integer.valueOf(i)}).toString(); 25 | } 26 | 27 | System.out.println("Time: " + (System.currentTimeMillis() - start)); 28 | } 29 | 30 | public static void main(String[] args) { 31 | ColdClass.foo(); 32 | hotCode(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/OsxAppBundleFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class OsxAppBundleFunTest extends BaseFunTest { 6 | 7 | @IgnoreIf({!isOSX}) 8 | def "test osx bundle configuration"() { 9 | setup: 10 | File infoPlist = new File(basedir, "build/jet/HelloSwing.app/Contents/Info.plist") 11 | 12 | when: 13 | runGradle("clean", "jetBuild") 14 | 15 | then: 16 | appExeFile.exists() 17 | infoPlist.exists() 18 | infoPlist.text.contains("CFBundleIconFile") 19 | infoPlist.text.contains("com.excelsior") 20 | } 21 | 22 | @Override 23 | protected String testProjectDir() { 24 | return "14-osx-app-bundle" 25 | } 26 | 27 | @Override 28 | protected String projectName() { 29 | return "HelloSwing" 30 | } 31 | 32 | @Override 33 | protected String projectVersion() { 34 | return "1.0-SNAPSHOT" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/resources/17-fullstacktrace-splashfrommanifest-chineselocale/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | jar { 17 | manifest { 18 | attributes("Main-Class" : "HelloWorld", 19 | "SplashScreen-Image": "splash.png") 20 | } 21 | } 22 | 23 | apply plugin: 'excelsiorJet' 24 | excelsiorJet { 25 | packaging = "none" 26 | mainClass = "HelloWorld" 27 | stackTraceSupport = "full" 28 | inlineExpansion = "very-aggressive" 29 | runtime { 30 | locales = ["Chinese"] 31 | } 32 | pdb { 33 | keepInBuildDir = true 34 | } 35 | } 36 | 37 | repositories { 38 | mavenCentral() 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/test/resources/15-hellotomcat/src/main/java/HelloServlet.java: -------------------------------------------------------------------------------- 1 | import javax.servlet.http.HttpServlet; 2 | import javax.servlet.ServletException; 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | 6 | import java.io.IOException; 7 | import java.io.PrintWriter; 8 | 9 | public class HelloServlet extends HttpServlet { 10 | 11 | protected void doGet(HttpServletRequest request, 12 | HttpServletResponse response) throws ServletException, IOException { 13 | // Very simple - just return some plain text 14 | response.setContentType("text/html"); 15 | PrintWriter writer = response.getWriter(); 16 | writer.println("\n" + 18 | "\n" + 19 | "Hello World\n" + 20 | "\n" + 21 | "

Hello World!

\n" + 22 | ""); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/DiskFootprintReductionFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class DiskFootprintReductionFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!highDiskFootprintReductionSupported}) 9 | def "test disk footprint reduction"() { 10 | setup: 11 | File rt0Jar = new File(basedir, "build/jet/app/rt/lib/rt-0.jar") 12 | 13 | when: 14 | def result = runGradle('clean', 'jetTestRun', 'jetBuild') 15 | 16 | then: 17 | rt0Jar.exists() 18 | 19 | result.task(":clean").outcome == TaskOutcome.SUCCESS || result.task(":clean").outcome == TaskOutcome.UP_TO_DATE 20 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | @Override 25 | protected String testProjectDir() { 26 | return "27-disk-footprint-reduction" 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/22-with-file-dependencies/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "AppWithFileDeps" 19 | optimizationPreset = "smart" 20 | pdb { 21 | keepInBuildDir = true 22 | } 23 | dependencies { 24 | dependency { 25 | path = new File(project.projectDir, "libs/single/single-dep.jar") 26 | pack = 'all' 27 | } 28 | } 29 | } 30 | 31 | repositories { 32 | mavenCentral() 33 | } 34 | 35 | dependencies { 36 | compile "org.apache.commons:commons-io:1.3.2" 37 | compile files('libs/single/single-dep.jar') 38 | compile fileTree(dir: 'libs/multi', include: '*.jar') 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/src/main/java/sample/war/MyController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample.war; 18 | 19 | import org.springframework.web.bind.annotation.GetMapping; 20 | import org.springframework.web.bind.annotation.RestController; 21 | 22 | @RestController 23 | public class MyController { 24 | 25 | @GetMapping("/") 26 | public String hello() { 27 | return "Hello World!"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/InvocationDynamicLibraryFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class InvocationDynamicLibraryFunTest extends BaseFunTest { 6 | 7 | def "jetBuild task builds invocation dynamic library"() { 8 | when: 9 | def result = runGradle('jetBuild') 10 | 11 | then: 12 | String dllname = mangleDllName("HelloDll") 13 | 14 | File dllFile = new File(jetBuildDir, dllname) 15 | dllFile.exists() 16 | !dllFile.text.contains("") 17 | File dllFileInApp = new File(appDir, dllname) 18 | dllFileInApp.exists() 19 | 20 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 21 | } 22 | 23 | public String testProjectDir() { 24 | return "23-invocation-dynamic-library" 25 | } 26 | 27 | @Override 28 | protected String projectName() { 29 | return "HelloDll" 30 | } 31 | 32 | @Override 33 | protected String projectVersion() { 34 | return "1.0-SNAPSHOT" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/WindowsVersionInfoFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | @IgnoreIf({!windowsVersionInfoSupported}) 7 | class WindowsVersionInfoFunTest extends BaseFunTest implements HelloWorldProject { 8 | 9 | def "jetBuild task builds simple application with windows version info"() { 10 | when: 11 | def versionRes = new File(basedir, "build/jet/build/HelloWorld_jetpdb/version.rc"); 12 | def result = runGradle('jetBuild') 13 | 14 | then: 15 | versionRes.exists() 16 | String versionResText = versionRes.text; 17 | versionResText.contains("MyCompany") 18 | versionResText.contains("MyProduct") 19 | versionResText.contains("4.3.2.1") 20 | versionResText.contains("MyCopyright") 21 | versionResText.contains("My description") 22 | 23 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 24 | } 25 | 26 | String testProjectDir() { 27 | return "28-windows-version-info" 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/HelloSwingFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class HelloSwingFunTest extends BaseFunTest { 6 | 7 | def "jetBuild task builds simple swing application"() { 8 | when: 9 | def result = runGradle('jetBuild') 10 | 11 | then: 12 | buildExeFile.exists() 13 | appExeFile.exists() 14 | zipFile.exists() 15 | 16 | !isWindows || new File(basedir, "build/jet/build/HelloSwing_jetpdb/HelloSwing.rsp").text.contains("icon.ico") 17 | !isWindows || new File(basedir, "build/jet/build/HelloSwing_jetpdb/HelloSwing.rsp").text.contains("-sys=W") 18 | 19 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 20 | } 21 | 22 | 23 | @Override 24 | protected String testProjectDir() { 25 | return "03-helloswing" 26 | } 27 | 28 | @Override 29 | protected String projectName() { 30 | return "HelloSwing" 31 | } 32 | 33 | @Override 34 | protected String projectVersion() { 35 | return "1.0-SNAPSHOT" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/src/main/java/sample/tomcat/service/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample.tomcat.service; 18 | 19 | import org.springframework.beans.factory.annotation.Value; 20 | import org.springframework.stereotype.Component; 21 | 22 | @Component 23 | public class HelloWorldService { 24 | 25 | @Value("${name:World}") 26 | private String name; 27 | 28 | public String getHelloMessage() { 29 | return "Hello " + this.name; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/test/resources/34-tomcat-port/src/main/java/HelloServlet.java: -------------------------------------------------------------------------------- 1 | import java.io.IOException; 2 | import java.io.StringReader; 3 | import java.lang.System; 4 | 5 | import javax.servlet.http.HttpServlet; 6 | import javax.servlet.ServletException; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import java.io.IOException; 11 | import java.io.PrintWriter; 12 | 13 | public class HelloServlet extends HttpServlet { 14 | 15 | protected void doGet(HttpServletRequest request, 16 | HttpServletResponse response) throws ServletException, IOException { 17 | // Very simple - just return some plain text 18 | response.setContentType("text/html"); 19 | PrintWriter writer = response.getWriter(); 20 | writer.println("\n" + 22 | "\n" + 23 | "Hello World\n" + 24 | "\n" + 25 | "

Hello World!

\n" + 26 | ""); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/test/resources/40-regression-excelsior-installer-no-shortcut-icon/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | packaging = 'excelsior-installer' 20 | excelsiorInstaller { 21 | shortcuts { 22 | shortcut { 23 | location = "program-folder" 24 | target = "README.txt" 25 | name = "Read me first" 26 | } 27 | } 28 | fileAssociations { 29 | fileAssociation { 30 | extension = "abc" 31 | target = "HelloWorld.exe" 32 | description = "ABC Files" 33 | targetDescription = "Super Duper Program" 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TomcatPortFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class TomcatPortFunTest extends BaseFunTest { 6 | 7 | @IgnoreIf({!tomcatSupported || !excelsiorInstallerSupported || !since11_3}) 8 | def "test tomcat port"() { 9 | given: 10 | File installer = new File(basedir, "build/jet/${projectName()}-" + projectVersion() + ext) 11 | File xpackArgsFile = new File(basedir, "build/jet/build/HelloTomcat.EI.xpack") 12 | 13 | when: 14 | runGradle("clean", "war", "jetBuild") 15 | 16 | then: 17 | new File(appDir, "bin/HelloTomcat$ext").exists() 18 | installer.exists() 19 | xpackArgsFile.text.contains("-allow-user-to-change-tomcat-port") 20 | } 21 | 22 | @Override 23 | protected String testProjectDir() { 24 | return "34-tomcat-port" 25 | } 26 | 27 | @Override 28 | protected String projectName() { 29 | return "HelloTomcat" 30 | } 31 | 32 | @Override 33 | protected String projectVersion() { 34 | return "1.0-SNAPSHOT" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ExcelsiorInstallerFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class ExcelsiorInstallerFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!excelsiorInstallerSupported}) 9 | def "jetBuild task builds simple swing application and packs it with excelsior installer"() { 10 | setup: 11 | File installer = new File(basedir, "build/jet/HelloSwing-1.2.3-SNAPSHOT" + ext) 12 | 13 | when: 14 | def result = runGradle('jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | installer.exists(); 20 | 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | @Override 25 | protected String testProjectDir() { 26 | return "04-excelsior-installer" 27 | } 28 | 29 | @Override 30 | protected String projectName() { 31 | return "HelloSwing" 32 | } 33 | 34 | @Override 35 | protected String projectVersion() { 36 | return "1.2.3-SNAPSHOT" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/MultiAppRunArgsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class MultiAppRunArgsFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({crossCompilation || !multiAppSupported}) 9 | def "multiAppRunArgs is passed to startup accelerator and run"() { 10 | when: 11 | def result = runGradle('jetBuild', 'jetRun') 12 | 13 | then: 14 | buildExeFile.exists() 15 | appExeFile.exists() 16 | 17 | !result.output.contains("No arguments specified") 18 | !result.output.contains("The application has terminated with exit code: 3") 19 | result.output.contains("The application has terminated with exit code: 0") 20 | result.output.contains("0: arg1") 21 | result.output.contains("1: arg2.1, arg2.2") 22 | 23 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 24 | result.task(":jetRun").outcome == TaskOutcome.SUCCESS 25 | } 26 | 27 | public String testProjectDir() { 28 | return "38-multiapp-run-arguments" 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/25-windows-service-multiapp-with-excelsior-installer/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | appType = "windows-service" 19 | mainClass = "SampleService" 20 | multiApp = true 21 | hideConsole = true 22 | windowsService { 23 | displayName = "Sample Service" 24 | description = "Sample Service created with Excelsior JET" 25 | arguments = ["-args", "arg", "arg with space", "arg3 with space"] 26 | logOnType = "user-account" 27 | startupType = "manual" 28 | dependencies = ["Dhcp", "Dnscache"] 29 | } 30 | packaging = "excelsior-installer" 31 | } 32 | 33 | repositories { 34 | mavenCentral() 35 | } 36 | 37 | dependencies { 38 | compileOnly "com.excelsiorjet:excelsior-jet-winservice-api:1.0.0" 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | plugins { 13 | id 'org.springframework.boot' version '2.0.4.RELEASE' 14 | } 15 | group = "com.excelsior.it" 16 | version = "1.0-SNAPSHOT" 17 | 18 | apply plugin: "war" 19 | apply plugin: "org.springframework.boot" 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | dependencies { 26 | compile "org.springframework.boot:spring-boot-starter:2.0.4.RELEASE" 27 | compile "org.springframework.boot:spring-boot-starter-web:2.0.4.RELEASE" 28 | } 29 | 30 | 31 | apply plugin: 'excelsiorJet' 32 | excelsiorJet { 33 | appType = "spring-boot" 34 | compilerOptions = ["+baselineall"] 35 | dependencies { 36 | dependency { 37 | artifactId = 'spring-boot-sample-war' 38 | pack = 'all' 39 | } 40 | dependency { 41 | artifactId = "spring-webmvc" 42 | protect = "not-required" 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/OptRtFilesFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class OptRtFilesFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "test additional RT-files"() { 8 | setup: 9 | File optRtJar = new File(basedir, "build/jet/app/rt/lib/ext/nashorn.jar") 10 | 11 | when: 12 | def result = runGradle('jetBuild') 13 | // should be in when, because requires directory created while run 14 | 15 | then: 16 | buildExeFile.exists() 17 | appExeFile.exists() 18 | zipFile.exists() 19 | 20 | ["build/jet/app/rt/bin/jfxwebkit.dll", 21 | "build/jet/app/rt/lib/libjfxwebkit.dylib", 22 | "build/jet/app/rt/lib/amd64/libjfxwebkit.so", 23 | "build/jet/app/rt/lib/i386/libjfxwebkit.so", 24 | "build/jet/app/rt/lib/arm/libjfxwebkit.so"].any { new File(basedir, it).exists()} 25 | 26 | optRtJar.exists() 27 | 28 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 29 | } 30 | 31 | @Override 32 | protected String testProjectDir() { 33 | return "08-optrtfiles" 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/PGOFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class PGOFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!PGOSupported || crossCompilation}) 9 | def "pgo test"() { 10 | when: 11 | def zipFile = new File(basedir, "build/jet/${projectName()}" + ".zip") 12 | def appToProfileExeFile = new File(basedir, "build/jet/appToProfile/${projectName()}$ext") 13 | def execProfile = new File( basedir, "src/main/jetresources/Test.jprof"); 14 | def result = runGradle('jetProfile', 'jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appToProfileExeFile.exists() 19 | execProfile.exists() 20 | appExeFile.exists() 21 | zipFile.exists() 22 | 23 | result.task(":jetProfile").outcome == TaskOutcome.SUCCESS 24 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 25 | } 26 | 27 | @Override 28 | String projectName() { 29 | return "Test" 30 | } 31 | 32 | public String testProjectDir() { 33 | return "36-pgo" 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ExcelsiorInstallerAdvancedFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class ExcelsiorInstallerAdvancedFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!excelsiorInstallerSupported}) 9 | def boolean "jetBuild task builds simple swing application and packs it with excelsior installer with cyrillic eula and splash in custom location"() { 10 | setup: 11 | File installer = new File(basedir, "build/jet/HelloSwing-1.2.3-SNAPSHOT" + ext) 12 | 13 | when: 14 | def result = runGradle('jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | installer.exists(); 20 | 21 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 22 | } 23 | 24 | @Override 25 | protected String testProjectDir() { 26 | return "05-excelsior-installer-advanced" 27 | } 28 | 29 | @Override 30 | protected String projectName() { 31 | return "HelloSwing" 32 | } 33 | 34 | @Override 35 | protected String projectVersion() { 36 | return "1.2.3-SNAPSHOT" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/JvmArgsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class JvmArgsFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | @IgnoreIf({crossCompilation}) 8 | def "test jvm args configuration"() { 9 | setup: 10 | def runOutBuildFile = new File(basedir, "build/jet/build/run.out") 11 | def rtPathBuild = new File(basedir, "build/jet/build/rt").getAbsolutePath() 12 | 13 | def runOutAppFile = new File(appDir, "run.out") 14 | def rtPathApp = new File(appDir, "rt").getAbsolutePath() 15 | 16 | when: 17 | runGradle("clean", "jetTestRun", "jetBuild") 18 | appExeFile.getAbsolutePath().execute([], appDir).waitForOrKill(2000) 19 | 20 | then: 21 | runOutBuildFile.text.replace("/",File.separator).trim().equals(rtPathBuild) 22 | runOutAppFile.text.replace("/",File.separator).trim().equals(rtPathApp) 23 | 24 | appExeFile.exists() 25 | } 26 | 27 | @Override 28 | protected String testProjectDir() { 29 | return "12-jvmargs" 30 | } 31 | 32 | @Override 33 | String projectName() { 34 | return "JVMArgs" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/PackageFilesFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class PackageFilesFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "test package files"() { 8 | when: 9 | def result = (!crossCompilation) ? runGradle('jetTestRun', 'jetBuild') : runGradle('jetBuild') 10 | 11 | then: 12 | buildExeFile.exists() 13 | appExeFile.exists() 14 | zipFile.exists() 15 | 16 | if (!crossCompilation) { 17 | new File(basedir, "build/jet/build/customfiles/custom.file").exists() 18 | new File(basedir, "build/jet/build/subdir/subdir.file").exists() 19 | } 20 | new File(basedir, "build/jet/app/customfiles/custom.file").exists() 21 | new File(basedir, "build/jet/app/subdir/subdir.file").exists() 22 | 23 | if (!crossCompilation) { 24 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 25 | } 26 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | @Override 30 | protected String testProjectDir() { 31 | return "31-package-files" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TestRunFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class TestRunFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({crossCompilation}) 9 | def "executes test run for project"() { 10 | setup: 11 | File startupProfile = new File( basedir, "src/main/jetresources/HelloWorld.startup"); 12 | File reorderFile = new File(basedir, "build/jet/build/HelloWorld_jetpdb/reorder.li") 13 | 14 | when: 15 | def result = runGradle('jetTestRun', 'jetBuild') 16 | 17 | then: 18 | if (startupProfileGenerationSupported) { 19 | startupProfile.exists() 20 | reorderFile.exists(); 21 | new File(basedir, "build/jet/build/custom.file").exists() 22 | new File(basedir, "build/jet/build/subdir/subdir.file").exists() 23 | } 24 | 25 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 26 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | @Override 30 | protected String testProjectDir() { 31 | return "07-testrun" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/CustomResourcesFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class CustomResourcesFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "test custom resources"() { 8 | when: 9 | def result = (!crossCompilation) ? runGradle('jetTestRun', 'jetBuild') : runGradle('jetBuild') 10 | 11 | then: 12 | buildExeFile.exists() 13 | appExeFile.exists() 14 | zipFile.exists() 15 | 16 | if (!crossCompilation) { 17 | new File(basedir, "build/jet/build/customfiles/custom.file").exists() 18 | new File(basedir, "build/jet/build/customfiles/subdir/subdir.file").exists() 19 | } 20 | new File(basedir, "build/jet/app/custom.file").exists() 21 | new File(basedir, "build/jet/app/subdir/subdir.file").exists() 22 | 23 | if (!crossCompilation) { 24 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 25 | } 26 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | @Override 30 | protected String testProjectDir() { 31 | return "10-customresources" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/RunArgsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class RunArgsFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({crossCompilation}) 9 | def "runArgs is passed to startup accelerator and test runs"() { 10 | when: 11 | def result = runGradle('jetTestRun', 'jetBuild', 'jetRun') 12 | 13 | then: 14 | buildExeFile.exists() 15 | appExeFile.exists() 16 | zipFile.exists() 17 | 18 | !result.output.contains("No arguments specified") 19 | !result.output.contains("The application has terminated with exit code: 3") 20 | result.output.contains("The application has terminated with exit code: 0") 21 | result.output.contains("0: arg1") 22 | result.output.contains("1: arg2.1, arg2.2") 23 | 24 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 25 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 26 | result.task(":jetRun").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | public String testProjectDir() { 30 | return "19-run-arguments" 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/StopTaskFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class StopTaskFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | protected static final String gradleExec = System.getProperty("gradle.exec") 9 | 10 | @IgnoreIf({crossCompilation || (gradleExec == null) || !PGOSupported}) 11 | def "stops test run, profile, run tasks "() { 12 | setup: 13 | 14 | when: 15 | def result = runGradle("jetTestRun", "jetProfile", "jetBuild", "jetRun", "-Dgradle.exec=" + gradleExec) 16 | 17 | then: 18 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 19 | result.task(":jetProfile").outcome == TaskOutcome.SUCCESS 20 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 21 | result.task(":jetRun").outcome == TaskOutcome.SUCCESS 22 | !(new File(basedir, "build/jet/build/failed").exists()) 23 | !(new File(basedir, "build/jet/app/failed").exists()) 24 | !(new File(basedir, "build/jet/appToPofile/failed").exists()) 25 | } 26 | 27 | @Override 28 | protected String testProjectDir() { 29 | return "46-stop-task" 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /funTests.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration required to execute functional tests from gradle and IDE 3 | */ 4 | 5 | test { 6 | systemProperty 'excelsiorJetPluginVersion', version 7 | systemProperty 'jet.home', System.properties['jet.home'] 8 | systemProperty 'tomcat.home', System.properties['tomcat.home'] 9 | systemProperty 'gradle.exec', System.properties['gradle.exec'] 10 | testLogging { 11 | events "started", "passed", "skipped", "failed"//, "standardOut", "standardError" 12 | info { 13 | showStandardStreams = true 14 | } 15 | } 16 | } 17 | 18 | // put plugin into maven local before tests, so it's become available for tests 19 | test.dependsOn(install) 20 | 21 | // Need to debug plugin from IDE 22 | // Write the plugin's classpath to a file to share with the tests 23 | task createClasspathManifest { 24 | def outputDir = file("$buildDir/$name") 25 | 26 | inputs.files sourceSets.main.runtimeClasspath 27 | outputs.dir outputDir 28 | 29 | doLast { 30 | outputDir.mkdirs() 31 | file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n") 32 | } 33 | } 34 | // Add the classpath file to the test runtime classpath 35 | dependencies { 36 | testRuntime files(createClasspathManifest) 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | plugins { 13 | id 'org.springframework.boot' version '2.0.4.RELEASE' 14 | } 15 | group = "com.excelsior.it" 16 | version = "1.0-SNAPSHOT" 17 | 18 | apply plugin: "java" 19 | apply plugin: "org.springframework.boot" 20 | 21 | repositories { 22 | mavenCentral() 23 | } 24 | 25 | dependencies { 26 | compile "org.springframework.boot:spring-boot-starter:2.0.4.RELEASE" 27 | compile "org.springframework.boot:spring-boot-starter-tomcat:2.0.4.RELEASE" 28 | compile "org.springframework:spring-webmvc:5.0.8.RELEASE" 29 | } 30 | 31 | 32 | apply plugin: 'excelsiorJet' 33 | excelsiorJet { 34 | appType = "spring-boot" 35 | compilerOptions = ["+baselineall"] 36 | dependencies { 37 | dependency { 38 | artifactId = 'spring-boot-sample-tomcat' 39 | pack = 'none' 40 | } 41 | dependency { 42 | artifactId = "spring-webmvc" 43 | protect = "not-required" 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/RunArgsViaSysPropsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class RunArgsViaSysPropsFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({crossCompilation}) 9 | def "runArgs is passed to startup accelerator and test runs via sys props"() { 10 | when: 11 | System.properties["jet.runArgs"] = "arg1,arg2.1\\, arg2.2" 12 | def result = runGradle('jetTestRun', 'jetBuild') 13 | 14 | then: 15 | buildExeFile.exists() 16 | appExeFile.exists() 17 | zipFile.exists() 18 | 19 | !result.output.contains("No arguments specified") 20 | !result.output.contains("The application has terminated with exit code: 3") 21 | result.output.contains("The application has terminated with exit code: 0") 22 | result.output.contains("0: arg1") 23 | result.output.contains("1: arg2.1, arg2.2") 24 | 25 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 26 | result.task(":jetTestRun").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | public String testProjectDir() { 30 | return "20-run-arguments-via-system-props" 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/AppWithTransDepFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class AppWithTransDepFunTest extends BaseFunTest { 6 | 7 | def "jetBuild task builds simple application with transitive dependency"() { 8 | setup: 9 | File dep = new File(basedir, "build/jet/build/AppWithDep_jetpdb/tmpres/jackson-databind-2.8.0__1.jar") 10 | File transDep = new File(basedir, "build/jet/build/AppWithDep_jetpdb/tmpres/jackson-core-2.8.0__3.jar") 11 | 12 | when: 13 | def result = runGradle('jetBuild') 14 | 15 | then: 16 | buildExeFile.exists() 17 | appExeFile.exists() 18 | zipFile.exists() 19 | dep.exists() 20 | transDep.exists() 21 | 22 | checkStdOutContains("field1", appExeFile) 23 | 24 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 25 | } 26 | 27 | 28 | @Override 29 | protected String testProjectDir() { 30 | return "16-with-transitive-dependency" 31 | } 32 | 33 | @Override 34 | protected String projectName() { 35 | return "AppWithDep" 36 | } 37 | 38 | @Override 39 | protected String projectVersion() { 40 | return "1.0-SNAPSHOT" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/resources/15-hellotomcat/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "war" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | tomcat { 19 | warDeployName = "ROOT" 20 | hideConfig = false 21 | genScripts = false 22 | } 23 | windowsService { 24 | description = "Jet Compiled Tomcat" 25 | } 26 | optimizationPreset = "smart" 27 | dependencies { 28 | dependency { 29 | artifactId = 'commons-io' 30 | pack = 'all' 31 | } 32 | dependency { 33 | artifactId = "HelloTomcat" 34 | protect = "not-required" 35 | } 36 | } 37 | packaging = "excelsior-installer" 38 | pdb { 39 | keepInBuildDir = true 40 | } 41 | } 42 | 43 | repositories { 44 | mavenCentral() 45 | } 46 | 47 | dependencies { 48 | compileOnly "javax.servlet:javax.servlet-api:3.0.1" 49 | compile "org.apache.commons:commons-io:1.3.2" 50 | } 51 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ProfileNotLocallyFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class ProfileNotLocallyFunTest extends BaseFunTest implements HelloWorldProject { 7 | 8 | @IgnoreIf({!PGOSupported}) 9 | def "profile not locally test"() { 10 | when: 11 | def appToProfileZipFile = new File(basedir, "build/jet/appToProfile.zip") 12 | def appToProfileDir = new File(basedir, "build/jet/appToProfile") 13 | def appToProfileExeFile = new File(appToProfileDir, "${projectName()}$ext") 14 | def execProfile = new File( appToProfileDir, "Test.jprof"); 15 | def result = runGradle('jetProfile') 16 | 17 | then: 18 | appToProfileZipFile.exists() 19 | appToProfileExeFile.exists() 20 | 21 | if (!crossCompilation) { 22 | appToProfileExeFile.getAbsolutePath().execute(null, appToProfileDir).text.contains("Time:") 23 | execProfile.exists() 24 | } 25 | 26 | result.task(":jetProfile").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | @Override 30 | String projectName() { 31 | return "Test" 32 | } 33 | 34 | public String testProjectDir() { 35 | return "37-profile-not-locally" 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/src/main/java/sample/tomcat/web/SampleController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample.tomcat.web; 18 | 19 | import sample.tomcat.service.HelloWorldService; 20 | 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.stereotype.Controller; 23 | import org.springframework.web.bind.annotation.GetMapping; 24 | import org.springframework.web.bind.annotation.ResponseBody; 25 | 26 | @Controller 27 | public class SampleController { 28 | 29 | @Autowired 30 | private HelloWorldService helloWorldService; 31 | 32 | @GetMapping("/") 33 | @ResponseBody 34 | public String helloWorld() { 35 | return this.helloWorldService.getHelloMessage(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/AppWithDepFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class AppWithDepFunTest extends BaseFunTest { 6 | 7 | def "jetBuild task builds simple application with dependency"() { 8 | setup: 9 | File prj = new File(basedir, "build/jet/build/AppWithDep.prj") 10 | File dep = new File(basedir, "build/jet/build/AppWithDep_jetpdb/tmpres/commons-io-1.3.2__1.jar") 11 | 12 | when: 13 | def result = runGradle('jetBuild') 14 | 15 | then: 16 | buildExeFile.exists() 17 | appExeFile.exists() 18 | zipFile.exists() 19 | dep.exists() 20 | def prjText = toUnixLineSeparators(prj.text) 21 | prjText.contains(""" 22 | !classpathentry lib/commons-io-1.3.2.jar 23 | -optimize=all 24 | -protect=all 25 | !end""") 26 | 27 | checkStdOutContains("HelloWorld", appExeFile) 28 | 29 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 30 | } 31 | 32 | 33 | @Override 34 | protected String testProjectDir() { 35 | return "02-withdependency" 36 | } 37 | 38 | @Override 39 | protected String projectName() { 40 | return "AppWithDep" 41 | } 42 | 43 | @Override 44 | protected String projectVersion() { 45 | return "1.0-SNAPSHOT" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/NoStackTraceSplashFromFileRuntimeClassicFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class NoStackTraceSplashFromFileRuntimeClassicFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "jetBuild task builds application with no stack trace, splash from file, -pack=all"() { 8 | when: 9 | def result = runGradle('jetBuild') 10 | 11 | then: 12 | buildExeFile.exists() 13 | appExeFile.exists() 14 | 15 | //check Unknown in stack trace 16 | checkStdOutContains("Hello World", appExeFile) 17 | 18 | //check tiny-methods only inline 19 | new File(basedir, "build/jet/build/HelloWorld.prj").text.contains("-inline-") 20 | 21 | //check splash in .rsp 22 | new File(basedir, "build/jet/build/HelloWorld_jetpdb/HelloWorld.rsp").text.contains("splash.png") 23 | 24 | //check -pack=all and splash from file (tmpres does not exist as no resources should be prepared) 25 | new File(basedir, "build/jet/build/HelloWorld_jetpdb/HelloWorld.rsp").text.contains('-config=RuntimeKind:CLASSIC') 26 | 27 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 28 | } 29 | 30 | public String testProjectDir() { 31 | return "18-nostacktrace-splashfromfile-runtimeclassic" 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/resources/32-excelsior-installer-advanced-11-3-common/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | def isWindows = System.properties['os.name'].toLowerCase().contains('windows') 17 | def exeExtension = isWindows ? ".exe" : "" 18 | def dllPrefix = isWindows ? "": "lib" 19 | def dllExtension = isWindows? ".dll" : ".so" 20 | 21 | apply plugin: 'excelsiorJet' 22 | excelsiorJet { 23 | mainClass = 'HelloWorld' 24 | packaging = 'excelsior-installer' 25 | excelsiorInstaller { 26 | language = "german" 27 | cleanupAfterUninstall = true 28 | compressionLevel = "fast" 29 | afterInstallRunnable { 30 | target = "HelloWorld${exeExtension}" 31 | arguments = ["arg", "arg with space"] 32 | } 33 | installationDirectory { 34 | type = "current-directory" 35 | path = "/mavenPluginTestEI" 36 | fixed = true 37 | } 38 | uninstallCallback { 39 | path = new File(project.projectDir, "${dllPrefix}uninstall${dllExtension}") 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/FullStackTraceSplashFromManfiestChineseLocaleFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class FullStackTraceSplashFromManfiestChineseLocaleFunTest extends BaseFunTest implements HelloWorldProject { 6 | 7 | def "jetBuild task builds application with full stack trace, splash from manifest, chinese locale"() { 8 | when: 9 | def result = runGradle('jetBuild') 10 | 11 | then: 12 | buildExeFile.exists() 13 | appExeFile.exists() 14 | 15 | //check lines in stack trace 16 | checkStdOutContains("Hello World", appExeFile) 17 | 18 | //check very-aggressive inline 19 | new File(basedir, "build/jet/build/HelloWorld.prj").text.contains("-inlinetolimit=2000") 20 | 21 | //check splash in resources 22 | new File(basedir, "build/jet/build/HelloWorld_jetpdb/tmpres/splash.png").exists() 23 | 24 | //check chinese locale 25 | new File(basedir, "build/jet/app/rt/jetrt").list().any{it.contains("XLCH")} 26 | 27 | //check no european locale 28 | !new File(basedir, "build/jet/app/rt/jetrt").list().any{it.contains("XLEU")} 29 | 30 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 31 | } 32 | 33 | public String testProjectDir() { 34 | return "17-fullstacktrace-splashfrommanifest-chineselocale" 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/RegressionExcelsiorInstallerNoShortcutIconFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class RegressionExcelsiorInstallerNoShortcutIconFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!advancedExcelsiorInstallerFeaturesSupported || !isWindows}) 9 | def boolean "regression test for excelsior installer configured with shortcuts without icon set"() { 10 | setup: 11 | File installer = new File(basedir, "build/jet/HelloWorld-1.0-SNAPSHOT" + ext) 12 | 13 | when: 14 | def result = runGradle('jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | installer.exists(); 20 | String xpackArgs = toUnixLineSeparators(new File(basedir, "build/jet/build/HelloWorld.EI.xpack").text) 21 | xpackArgs.contains(""" 22 | -shortcut program-folder README.txt "Read me first" "" "" "" 23 | -file-association abc HelloWorld.exe "ABC Files" "Super Duper Program" "" "" checked 24 | """) 25 | 26 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 27 | } 28 | 29 | @Override 30 | protected String testProjectDir() { 31 | return "40-regression-excelsior-installer-no-shortcut-icon" 32 | } 33 | 34 | @Override 35 | protected String projectName() { 36 | return "HelloWorld" 37 | } 38 | 39 | @Override 40 | protected String projectVersion() { 41 | return "1.2.3-SNAPSHOT" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetRunTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.ExcelsiorJet 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import com.excelsiorjet.api.tasks.RunTask 27 | import org.gradle.api.tasks.TaskAction 28 | 29 | /** 30 | * Task for running executables generated with Excelsior JET. 31 | * 32 | * @author Nikita Lipsky 33 | */ 34 | class JetRunTask extends AbstractBuildTask { 35 | 36 | @TaskAction 37 | def jetRun() { 38 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 39 | JetProject jetProject = createJetProject() 40 | new RunTask(excelsiorJet, jetProject).execute() 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/WindowsServiceFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class WindowsServiceFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!windowsServicesSupported}) 9 | def "jetBuild task builds windows service"() { 10 | when: 11 | def result = runGradle('jetBuild') 12 | def rspFile = new File(appDir, "SampleService.rsp"); 13 | File installBat = new File(appDir, "install.bat") 14 | File uninstallBat = new File(appDir, "uninstall.bat") 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | 20 | rspFile.exists(); 21 | String rspContents = toUnixLineSeparators(rspFile.text); 22 | rspContents.equals( 23 | """-install SampleService.exe 24 | -displayname "Sample Service" 25 | -description "Sample Service created with Excelsior JET" 26 | -auto 27 | -dependence Dhcp 28 | -dependence Dnscache 29 | -args 30 | arg 31 | arg with space 32 | """ 33 | ) 34 | 35 | installBat.exists() 36 | uninstallBat.exists() 37 | zipFile.exists() 38 | 39 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 40 | } 41 | 42 | public String testProjectDir() { 43 | return "24-windows-service" 44 | } 45 | 46 | @Override 47 | protected String projectName() { 48 | return "SampleService" 49 | } 50 | 51 | @Override 52 | protected String projectVersion() { 53 | return "1.0-SNAPSHOT" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/test/resources/45-spring-boot-war/src/main/java/sample/war/SampleWarApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample.war; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 22 | import org.springframework.context.annotation.PropertySource; 23 | 24 | @SpringBootApplication 25 | @PropertySource("WEB-INF/custom.properties") 26 | public class SampleWarApplication extends SpringBootServletInitializer { 27 | 28 | public static void main(String[] args) { 29 | (new Thread() { 30 | public void run() { 31 | try { 32 | //wait 10 seconds then exit 33 | Thread.sleep(10000); 34 | System.exit(0); 35 | } catch (InterruptedException e) { 36 | // do nothing 37 | } 38 | } 39 | }).start(); 40 | SpringApplication.run(SampleWarApplication.class, args); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetProfileTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.ExcelsiorJet 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import org.gradle.api.tasks.TaskAction 27 | 28 | /** 29 | * Task for profiling Java (JVM) applications with Excelsior JET. 30 | * 31 | * @see ExcelsiorJetExtension 32 | * 33 | * @author Nikita Lipsky 34 | */ 35 | class JetProfileTask extends AbstractBuildTask { 36 | 37 | @TaskAction 38 | def jetProfile() { 39 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 40 | JetProject jetProject = createJetProject() 41 | new com.excelsiorjet.api.tasks.JetBuildTask(excelsiorJet, jetProject, true).execute() 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/TomcatFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class TomcatFunTest extends BaseFunTest { 6 | 7 | @IgnoreIf({!tomcatSupported}) 8 | def "test tomcat configuration"() { 9 | given: 10 | def prjFile = new File(jetBuildDir, "HelloTomcat.prj") 11 | File installer = new File(basedir, "build/jet/${projectName()}-" + projectVersion() + ext) 12 | 13 | when: 14 | runGradle("clean", "war", "jetBuild") 15 | 16 | then: 17 | new File(appDir, "bin/HelloTomcat$ext").exists() 18 | excelsiorInstallerSupported && installer.exists() || zipFile.exists() 19 | 20 | new File(basedir, "build/jet/build/HelloTomcat_jetpdb/tmpres/ROOT/WEB-INF/lib/commons-io-1.3.2.jar").exists() 21 | 22 | 23 | //replace line separators to Unix as Groovy """ multiline strings produce Unix line separators 24 | def prjText = toUnixLineSeparators(prjFile.text) 25 | prjText.contains(""" 26 | !classloaderentry webapp webapps/ROOT:/WEB-INF/lib/commons-io-1.3.2.jar 27 | -optimize=autodetect 28 | -protect=nomatter 29 | -pack=all 30 | !end""") 31 | 32 | prjText.contains(""" 33 | !classloaderentry webapp webapps/ROOT:/WEB-INF/classes 34 | -optimize=all 35 | -protect=nomatter 36 | !end""") 37 | } 38 | 39 | @Override 40 | protected String testProjectDir() { 41 | return "15-hellotomcat" 42 | } 43 | 44 | @Override 45 | protected String projectName() { 46 | return "HelloTomcat" 47 | } 48 | 49 | @Override 50 | protected String projectVersion() { 51 | return "1.0-SNAPSHOT" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetStopTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.ExcelsiorJet 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import com.excelsiorjet.api.tasks.StopTask 27 | import com.excelsiorjet.api.tasks.TestRunTask 28 | import org.gradle.api.tasks.TaskAction 29 | 30 | /** 31 | * Task for stopping applications that were run by {@link JetTestRunTask}, {@link JetRunTask}, {@link JetProfileTask}. 32 | * 33 | * @author Nikita Lipsky 34 | */ 35 | class JetStopTask extends AbstractJetTask { 36 | 37 | @TaskAction 38 | def jetTestRun() { 39 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 40 | JetProject jetProject = createJetProject() 41 | new StopTask(excelsiorJet, jetProject).execute() 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/WithFileDependenciesTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | class WithFileDependenciesTest extends BaseFunTest { 6 | 7 | def "jetBuild task builds simple application with files(..) and fileTree(..) dependencies"() { 8 | setup: 9 | File depRepo = new File(basedir, "build/jet/build/AppWithFileDeps_jetpdb/tmpres/commons-io-1.3.2__1.jar") 10 | File depFileTreeFirst = new File(basedir, "build/jet/build/AppWithFileDeps_jetpdb/tmpres/first-multi-dep__2.jar") 11 | File depFileTreeSecond = new File(basedir, "build/jet/build/AppWithFileDeps_jetpdb/tmpres/second-multi-dep__3.jar") 12 | File prj = new File(basedir, "build/jet/build/AppWithFileDeps.prj") 13 | 14 | when: 15 | def result = runGradle('jetBuild') 16 | 17 | then: 18 | buildExeFile.exists() 19 | appExeFile.exists() 20 | zipFile.exists() 21 | depRepo.exists() 22 | depFileTreeFirst.exists() 23 | depFileTreeSecond.exists() 24 | def prjText = toUnixLineSeparators(prj.text) 25 | prjText.contains(""" 26 | !classpathentry lib/single-dep.jar 27 | -optimize=autodetect 28 | -protect=nomatter 29 | -pack=all 30 | !end""") 31 | 32 | checkStdOutContains("HelloWorld:SingleDep:FirstMultiDep:SecondMultiDep", appExeFile) 33 | 34 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 35 | } 36 | 37 | @Override 38 | protected String testProjectDir() { 39 | return "22-with-file-dependencies" 40 | } 41 | 42 | @Override 43 | protected String projectName() { 44 | return "AppWithFileDeps" 45 | } 46 | 47 | @Override 48 | protected String projectVersion() { 49 | return "1.0-SNAPSHOT" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/GradleLog.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.log.Log 25 | import org.gradle.api.logging.Logger 26 | 27 | /** 28 | * Implementation of {@link Log} that redirects logs into Gradle logging system. 29 | */ 30 | class GradleLog extends Log { 31 | 32 | private final Logger log; 33 | 34 | GradleLog(Logger log) { 35 | this.log = log 36 | } 37 | 38 | @Override 39 | void debug(String msg, Throwable t) { 40 | log.debug(msg, t) 41 | } 42 | 43 | @Override 44 | void info(String msg) { 45 | log.quiet(msg) 46 | } 47 | 48 | @Override 49 | void warn(String msg) { 50 | log.warn(msg) 51 | } 52 | 53 | @Override 54 | void warn(String msg, Throwable t) { 55 | log.warn(msg, t) 56 | } 57 | 58 | @Override 59 | void error(String msg) { 60 | log.error(msg) 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/WindowsServiceMultiAppWithExcelsiorInstallerFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class WindowsServiceMultiAppWithExcelsiorInstallerFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!windowsServicesInExcelsiorInstallerSupported}) 9 | def "jetBuild task builds windows service"() { 10 | when: 11 | def result = runGradle('jetBuild') 12 | def rspFile = new File(appDir, "SampleService.rsp"); 13 | File installer = new File(basedir, "build/jet/${projectName()}-" + projectVersion() + ext) 14 | File installBat = new File(appDir, "install.bat") 15 | File uninstallBat = new File(appDir, "uninstall.bat") 16 | 17 | then: 18 | buildExeFile.exists() 19 | appExeFile.exists() 20 | 21 | rspFile.exists(); 22 | String rspContents = toUnixLineSeparators(rspFile.text); 23 | rspContents.equals( 24 | """-install SampleService.exe 25 | -displayname "Sample Service" 26 | -description "Sample Service created with Excelsior JET" 27 | -manual 28 | -dependence Dhcp 29 | -dependence Dnscache 30 | -args 31 | -args 32 | arg 33 | arg with space 34 | arg3 with space 35 | """ 36 | ) 37 | 38 | installBat.exists() 39 | installBat.text.contains("-user %name% -password %password") 40 | uninstallBat.exists() 41 | installer.exists() 42 | 43 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 44 | } 45 | 46 | public String testProjectDir() { 47 | return "25-windows-service-multiapp-with-excelsior-installer" 48 | } 49 | 50 | @Override 51 | protected String projectName() { 52 | return "SampleService" 53 | } 54 | 55 | @Override 56 | protected String projectVersion() { 57 | return "1.0-SNAPSHOT" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ExcelsiorInstallerAdvanced11_3CommonFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class ExcelsiorInstallerAdvanced11_3CommonFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!excelsiorInstallerSupported || !since11_3}) 9 | def boolean "jetBuild task builds excelsior installer using common (Windows, Linux) xpack options available since 11.3"() { 10 | setup: 11 | File installer = new File(basedir, "build/jet/HelloWorld-1.0-SNAPSHOT" + ext) 12 | 13 | when: 14 | def result = runGradle('jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | installer.exists(); 20 | String xpackArgs = new File(basedir, "build/jet/build/HelloWorld.EI.xpack").text 21 | xpackArgs.contains("-language german") 22 | xpackArgs.contains("-cleanup-after-uninstall") 23 | xpackArgs.contains("-compression-level fast") 24 | xpackArgs.contains("-after-install-runnable HelloWorld") 25 | xpackArgs.contains("arg with space") 26 | xpackArgs.contains("-installation-directory /mavenPluginTestEI") 27 | xpackArgs.contains("-installation-directory-type current-directory") 28 | xpackArgs.contains("-installation-directory-fixed") 29 | xpackArgs.contains("-install-callback") 30 | xpackArgs.contains("-uninstall-callback") 31 | 32 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 33 | } 34 | 35 | @Override 36 | protected String testProjectDir() { 37 | return "32-excelsior-installer-advanced-11-3-common" 38 | } 39 | 40 | @Override 41 | protected String projectName() { 42 | return "HelloWorld" 43 | } 44 | 45 | @Override 46 | protected String projectVersion() { 47 | return "1.2.3-SNAPSHOT" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetBuildTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.ExcelsiorJet 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import com.excelsiorjet.api.tasks.JetTaskFailureException 27 | import org.gradle.api.tasks.TaskAction 28 | 29 | /** 30 | * Main task for building Java (JVM) applications with Excelsior JET. 31 | * 32 | * @see ExcelsiorJetExtension 33 | * 34 | * @author Aleksey Zhidkov 35 | */ 36 | class JetBuildTask extends AbstractBuildTask { 37 | 38 | @TaskAction 39 | def jetBuild() { 40 | try { 41 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 42 | JetProject jetProject = createJetProject() 43 | new com.excelsiorjet.api.tasks.JetBuildTask(excelsiorJet, jetProject, false).execute() 44 | } catch (JetTaskFailureException e) { 45 | //just rethrow 46 | throw e 47 | } catch (Throwable e) { 48 | e.printStackTrace() 49 | throw e; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/ExcelsiorInstallerAdvanced11_3WindowsFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | import spock.lang.IgnoreIf 5 | 6 | class ExcelsiorInstallerAdvanced11_3WindowsFunTest extends BaseFunTest { 7 | 8 | @IgnoreIf({!advancedExcelsiorInstallerFeaturesSupported || !isWindows}) 9 | def boolean "jetBuild task builds excelsior installer using xpack options available for Windows since 11.3"() { 10 | setup: 11 | File installer = new File(basedir, "build/jet/HelloWorld-1.0-SNAPSHOT" + ext) 12 | 13 | when: 14 | def result = runGradle('jetBuild') 15 | 16 | then: 17 | buildExeFile.exists() 18 | appExeFile.exists() 19 | installer.exists(); 20 | String xpackArgs = toUnixLineSeparators(new File(basedir, "build/jet/build/HelloWorld.EI.xpack").text) 21 | xpackArgs.contains("-registry-key excelsior/maven/tests") 22 | xpackArgs.contains(""" 23 | -shortcut program-folder README.txt "Read me first" /readme.ico "" "" 24 | -no-default-post-install-actions 25 | -post-install-checkbox-run run.bat workDir arg checked 26 | -post-install-checkbox-open README.txt checked 27 | -post-install-checkbox-restart unchecked 28 | -file-association abc HelloWorld.exe "ABC Files" "Super Duper Program" file.ico "" checked 29 | """) 30 | xpackArgs.contains("-welcome-image") 31 | xpackArgs.contains("-installer-image") 32 | xpackArgs.contains("-uninstaller-image") 33 | 34 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 35 | } 36 | 37 | @Override 38 | protected String testProjectDir() { 39 | return "33-excelsior-installer-advanced-11-3-windows" 40 | } 41 | 42 | @Override 43 | protected String projectName() { 44 | return "HelloWorld" 45 | } 46 | 47 | @Override 48 | protected String projectVersion() { 49 | return "1.2.3-SNAPSHOT" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/SpringBootWarFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class SpringBootWarFunTest extends BaseFunTest { 6 | 7 | @IgnoreIf({!springBootSupported || !PGOSupported}) 8 | def "test spring boot war"() { 9 | given: 10 | def exeFile = new File(basedir, "build/jet/app/spring-boot-sample-war" + ext) 11 | def zipFile = new File(basedir, "build/jet/spring-boot-sample-war-1.0-SNAPSHOT.zip") 12 | 13 | //profiles 14 | def profileExeFile = new File( basedir, "build/jet/appToProfile/spring-boot-sample-war" + ext) 15 | def profileFile = new File(basedir, "src/main/jetresources/spring-boot-sample-war.jprof"); 16 | def startupProfile = new File(basedir, "src/main/jetresources/spring-boot-sample-war.startup"); 17 | def usgProfile = new File(basedir, "src/main/jetresources/spring-boot-sample-war.usg"); 18 | 19 | def prjFile = new File(jetBuildDir, "spring-boot-sample-war.prj") 20 | 21 | when: 22 | runGradle('jetTestRun', 'jetProfile', 'jetBuild') 23 | 24 | then: 25 | exeFile.exists() 26 | zipFile.exists() 27 | 28 | //check profile 29 | profileExeFile.exists() 30 | profileFile.exists() 31 | startupProfile.exists() 32 | usgProfile.exists() 33 | usgProfile.text.contains("springboot%") 34 | 35 | prjFile.exists() 36 | def prjText = toUnixLineSeparators(prjFile.text) 37 | prjText.contains(""" 38 | !classloaderentry app spring-boot-sample-war-1.0-SNAPSHOT.war 39 | -pack=all 40 | !end""") 41 | } 42 | 43 | @Override 44 | protected String testProjectDir() { 45 | return "45-spring-boot-war" 46 | } 47 | 48 | @Override 49 | protected String projectName() { 50 | return "spring-boot-sample-war" 51 | } 52 | 53 | @Override 54 | protected String projectVersion() { 55 | return "1.0-SNAPSHOT" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/SpringBootFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import spock.lang.IgnoreIf 4 | 5 | class SpringBootFunTest extends BaseFunTest { 6 | 7 | @IgnoreIf({!springBootSupported || !PGOSupported}) 8 | def "test spring boot"() { 9 | given: 10 | def exeFile = new File(basedir, "build/jet/app/spring-boot-sample-tomcat" + ext) 11 | def jarFile = new File(basedir, "build/jet/app/spring-boot-sample-tomcat-1.0-SNAPSHOT.jar") 12 | def zipFile = new File(basedir, "build/jet/spring-boot-sample-tomcat-1.0-SNAPSHOT.zip") 13 | 14 | //profiles 15 | def profileExeFile = new File( basedir, "build/jet/appToProfile/spring-boot-sample-tomcat" + ext) 16 | def profileFile = new File(basedir, "src/main/jetresources/spring-boot-sample-tomcat.jprof"); 17 | def startupProfile = new File(basedir, "src/main/jetresources/spring-boot-sample-tomcat.startup"); 18 | def usgProfile = new File(basedir, "src/main/jetresources/spring-boot-sample-tomcat.usg"); 19 | 20 | def prjFile = new File(jetBuildDir, "spring-boot-sample-tomcat.prj") 21 | 22 | when: 23 | runGradle('jetTestRun', 'jetProfile', 'jetBuild') 24 | 25 | then: 26 | exeFile.exists() 27 | jarFile.exists() 28 | zipFile.exists() 29 | 30 | //check profile 31 | profileExeFile.exists() 32 | profileFile.exists() 33 | startupProfile.exists() 34 | usgProfile.exists() 35 | usgProfile.text.contains("springboot%") 36 | 37 | prjFile.exists() 38 | def prjText = toUnixLineSeparators(prjFile.text) 39 | prjText.contains(""" 40 | !classloaderentry app spring-boot-sample-tomcat-1.0-SNAPSHOT.jar 41 | -pack=none 42 | !end""") 43 | } 44 | 45 | @Override 46 | protected String testProjectDir() { 47 | return "44-spring-boot" 48 | } 49 | 50 | @Override 51 | protected String projectName() { 52 | return "spring-boot-sample-tomcat" 53 | } 54 | 55 | @Override 56 | protected String projectVersion() { 57 | return "1.0-SNAPSHOT" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/test/resources/44-spring-boot/src/main/java/sample/tomcat/SampleTomcatApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package sample.tomcat; 18 | 19 | import javax.servlet.ServletContextEvent; 20 | import javax.servlet.ServletContextListener; 21 | 22 | import org.apache.commons.logging.Log; 23 | import org.apache.commons.logging.LogFactory; 24 | 25 | import org.springframework.boot.SpringApplication; 26 | import org.springframework.boot.autoconfigure.SpringBootApplication; 27 | import org.springframework.context.annotation.Bean; 28 | 29 | @SpringBootApplication 30 | public class SampleTomcatApplication { 31 | 32 | private static Log logger = LogFactory.getLog(SampleTomcatApplication.class); 33 | 34 | @Bean 35 | protected ServletContextListener listener() { 36 | return new ServletContextListener() { 37 | 38 | @Override 39 | public void contextInitialized(ServletContextEvent sce) { 40 | logger.info("ServletContext initialized"); 41 | } 42 | 43 | @Override 44 | public void contextDestroyed(ServletContextEvent sce) { 45 | logger.info("ServletContext destroyed"); 46 | } 47 | 48 | }; 49 | } 50 | 51 | public static void main(String[] args) { 52 | (new Thread() { 53 | public void run() { 54 | try { 55 | //wait 10 seconds then exit 56 | Thread.sleep(10000); 57 | System.exit(0); 58 | } catch (InterruptedException e) { 59 | // do nothing 60 | } 61 | } 62 | }).start(); 63 | SpringApplication.run(SampleTomcatApplication.class, args); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/test/resources/33-excelsior-installer-advanced-11-3-windows/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = 'HelloWorld' 19 | packaging = 'excelsior-installer' 20 | excelsiorInstaller { 21 | cleanupAfterUninstall = true 22 | installationDirectory { 23 | type = "current-directory" 24 | } 25 | registryKey = "excelsior/maven/tests" 26 | shortcuts { 27 | shortcut { 28 | location = "program-folder" 29 | target = "README.txt" 30 | name = "Read me first" 31 | icon { 32 | path = new File (project.projectDir, "resources/readme.ico") 33 | } 34 | } 35 | } 36 | noDefaultPostInstallActions = true 37 | postInstallCheckboxes { 38 | postInstallCheckbox { 39 | type = "run" 40 | target = "run.bat" 41 | workingDirectory = "workDir" 42 | arguments = ["arg"] 43 | } 44 | postInstallCheckbox { 45 | type = "open" 46 | target = "README.txt" 47 | } 48 | postInstallCheckbox { 49 | type = "restart" 50 | checked = false 51 | } 52 | } 53 | fileAssociations { 54 | fileAssociation { 55 | extension = "abc" 56 | target = "HelloWorld.exe" 57 | description = "ABC Files" 58 | targetDescription = "Super Duper Program" 59 | icon { 60 | packagePath = "file.ico" 61 | } 62 | } 63 | } 64 | welcomeImage = new File(project.projectDir, "resources/big.bmp") 65 | } 66 | } -------------------------------------------------------------------------------- /src/test/resources/21-dependencymanagement/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | def pluginVersion = System.properties['excelsiorJetPluginVersion'] 3 | repositories { 4 | mavenLocal() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath "com.excelsiorjet:excelsior-jet-gradle-plugin:$pluginVersion" 9 | } 10 | } 11 | 12 | apply plugin: "java" 13 | group = "com.excelsior.it" 14 | version = "1.0-SNAPSHOT" 15 | 16 | apply plugin: 'excelsiorJet' 17 | excelsiorJet { 18 | mainClass = "AppWithDep" 19 | optimizationPreset = "smart" 20 | dependencies { 21 | dependency { 22 | artifactId = 'commons-io' 23 | pack = 'all' 24 | } 25 | dependency { 26 | path = new File(project.projectDir, "lib/junit-4.8.2.jar") 27 | pack = 'all' 28 | protect = 'all' 29 | optimize = 'all' 30 | } 31 | dependency { 32 | artifactId = 'jackson-databind' 33 | pack = 'none' 34 | } 35 | dependency { 36 | artifactId = 'log4j' 37 | pack = 'none' 38 | packagePath = 'libs' 39 | } 40 | dependency { 41 | path = new File(project.projectDir, "extDir") 42 | pack = 'none' 43 | } 44 | dependency { 45 | path = new File(project.projectDir, "extDir2") 46 | packagePath = 'extDirCp' 47 | } 48 | // xpack will halts with error if not packed resource would not be disabled 49 | dependency { 50 | path = new File(project.projectDir, "lib/google-collections-1.0.jar") 51 | pack = 'none' 52 | disableCopyToPackage = true 53 | } 54 | dependency { 55 | groupId = 'com.fasterxml.jackson.core' 56 | protect = 'all' 57 | } 58 | dependency { 59 | groupId = 'com.fasterxml.jackson.core' 60 | artifactId = 'jackson-core' 61 | isLibrary = false 62 | } 63 | } 64 | } 65 | 66 | repositories { 67 | mavenCentral() 68 | flatDir { 69 | dirs 'lib' 70 | } 71 | } 72 | 73 | dependencies { 74 | compile "org.apache.commons:commons-io:1.3.2" 75 | compile "com.fasterxml.jackson.core:jackson-databind:2.8.0" 76 | compile "log4j:log4j:1.2.17" 77 | compile name: "junit-4.8.2" 78 | } 79 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/test/resources/24-windows-service/src/main/java/SampleService.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | import java.text.*; 4 | 5 | public class SampleService extends com.excelsior.service.WinService { 6 | private Object pauseLock = new Object(); 7 | private static DateFormat formatter = null; 8 | private volatile boolean paused = false; 9 | 10 | static { 11 | formatter = new SimpleDateFormat("HH:mm:ss dd MMM yyyy", Locale.getDefault()); 12 | formatter.setTimeZone(TimeZone.getDefault()); 13 | } 14 | 15 | public void run() { 16 | logInfoEvent("run() method called, service started"); 17 | 18 | for (; ; ) { 19 | if (paused) { 20 | 21 | // locking service run thread 22 | 23 | synchronized (pauseLock) { 24 | try { 25 | pauseLock.wait(); 26 | } catch (InterruptedException t) { 27 | } 28 | } 29 | } 30 | 31 | // working... 32 | 33 | logInfoEvent("service is working"); 34 | logInfoEvent("current date: " + formatter.format(new Date())); 35 | 36 | try { 37 | Thread.sleep(15000); 38 | } catch (InterruptedException t) { 39 | } 40 | } 41 | } 42 | 43 | public boolean init() { 44 | // things to do before service run 45 | 46 | logInfoEvent("init() method called, initializing service..."); 47 | 48 | for (String arg: getArgs()) { 49 | logInfoEvent(arg); 50 | } 51 | 52 | // set timeouts... 53 | 54 | setInitTimeout(1000); 55 | setPauseTimeout(1000); 56 | setResumeTimeout(1000); 57 | setStopTimeout(1000); 58 | 59 | logInfoEvent("service initialized"); 60 | 61 | return true; 62 | } 63 | 64 | public void shutdown() { 65 | // things to do before service shutdown 66 | } 67 | 68 | public void stop() { 69 | // things to do before service stop 70 | 71 | logInfoEvent("stop() method called, service is stopped"); 72 | } 73 | 74 | public void pause() { 75 | // things to do before service pause 76 | 77 | logInfoEvent("pause() method called, service is paused"); 78 | paused = true; 79 | } 80 | 81 | public void resume() { 82 | // things to do before service resume 83 | 84 | logInfoEvent("resume() method called, service is resumed"); 85 | paused = false; 86 | 87 | synchronized (pauseLock) { 88 | 89 | // unlocking service run thread 90 | pauseLock.notify(); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /src/test/groovy/com/excelsiorjet/gradle/plugin/DependencyManagementFunTest.groovy: -------------------------------------------------------------------------------- 1 | package com.excelsiorjet.gradle.plugin 2 | 3 | import org.gradle.testkit.runner.TaskOutcome 4 | 5 | 6 | class DependencyManagementFunTest extends BaseFunTest { 7 | 8 | def "jetBuild task accounts dependency settings"() { 9 | setup: 10 | File dep = new File(basedir, "build/jet/build/lib/commons-io-1.3.2.jar") 11 | File prj = new File(basedir, "build/jet/build/AppWithDep.prj") 12 | File junitLib = new File(basedir, "build/jet/build/lib/junit-4.8.2.jar") 13 | File jacksonDep = new File(basedir, "build/jet/build/lib/jackson-databind-2.8.0.jar") 14 | File log4jDep = new File(basedir, "build/jet/build/libs/log4j-1.2.17.jar") 15 | File extDirContent= new File(basedir, "build/jet/build/extDir/test.txt") 16 | File extDirCpContent = new File(basedir, "build/jet/build/extDirCp/extDir2/test.txt") 17 | 18 | when: 19 | def result = runGradle('jetBuild') 20 | 21 | then: 22 | buildExeFile.exists() 23 | appExeFile.exists() 24 | zipFile.exists() 25 | 26 | dep.exists() 27 | 28 | //replace line separators to Unix as Groovy """ multiline strings produce Unix line separators 29 | def prjText = toUnixLineSeparators(prj.text) 30 | prjText.contains(""" 31 | !classpathentry lib/commons-io-1.3.2.jar 32 | -optimize=autodetect 33 | -protect=nomatter 34 | -pack=all 35 | !end""") 36 | 37 | junitLib.exists() 38 | prjText.contains(""" 39 | !classpathentry lib/junit-4.8.2.jar 40 | -optimize=all 41 | -protect=all 42 | -pack=all 43 | !end""") 44 | 45 | jacksonDep.exists() 46 | prjText.contains(""" 47 | !classpathentry lib/jackson-databind-2.8.0.jar 48 | -optimize=autodetect 49 | -protect=all 50 | -pack=none 51 | !end""") 52 | prjText.contains(""" 53 | !classpathentry lib/jackson-annotations-2.8.0.jar 54 | -optimize=autodetect 55 | -protect=all 56 | !end""") 57 | prjText.contains(""" 58 | !classpathentry lib/jackson-core-2.8.0.jar 59 | -optimize=all 60 | -protect=all 61 | !end""") 62 | 63 | log4jDep.exists() 64 | prjText.contains(""" 65 | !classpathentry libs/log4j-1.2.17.jar 66 | -optimize=autodetect 67 | -protect=nomatter 68 | -pack=none 69 | !end""") 70 | 71 | extDirContent.exists() 72 | extDirCpContent.exists() 73 | 74 | checkStdOutContains("HelloWorld", appExeFile) 75 | 76 | result.task(":jetBuild").outcome == TaskOutcome.SUCCESS 77 | } 78 | 79 | @Override 80 | protected String testProjectDir() { 81 | return '21-dependencymanagement' 82 | } 83 | 84 | @Override 85 | protected String projectName() { 86 | return 'AppWithDep' 87 | } 88 | 89 | @Override 90 | protected String projectVersion() { 91 | return "1.0-SNAPSHOT" 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/JetTestRunTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.ExcelsiorJet 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import com.excelsiorjet.api.tasks.TestRunTask 27 | import org.gradle.api.tasks.TaskAction 28 | 29 | /** 30 | * Task for performing a Test Run before building the application. 31 | * Running your Java application before optimization helps Excelsior JET: 32 | *
    33 | *
  • 34 | * Verify that your application can run on the Excelsior JET JVM flawlessly 35 | * (i.e. it has no implicit dependencies on the Oracle JVM implementation 36 | * and your Gradle project has no configuration issues specific to Excelsior JET). 37 | *
  • 38 | *
  • 39 | * Collect profile information to optimize your app more effectively. 40 | *
  • 41 | *
  • 42 | * Enable application startup time optimization. 43 | * Performing a Test Run can reduce the startup time by a factor of up to two. 44 | *
  • 45 | *
46 | * To perform a Test Run, issue the following Gradle command: 47 | *

48 | * 49 | * gradlew jetTestRun 50 | * 51 | *

52 | *

53 | * It is recommended to commit the collected profiles (.usg, .startup) to VCS so as to 54 | * enable the plugin to re-use them during subsequent builds without performing the Test Run. 55 | * The profiles are placed to {@link ExcelsiorJetExtension#jetResourcesDir} by default. 56 | *

57 | * 58 | * Note: During a Test Run, the application is executed in a special profiling mode, 59 | * so disregard its modest start-up time and performance. 60 | * 61 | * 62 | * @see ExcelsiorJetExtension 63 | * 64 | * @author Aleksey Zhidkov 65 | */ 66 | class JetTestRunTask extends AbstractJetTask { 67 | 68 | @TaskAction 69 | def jetTestRun() { 70 | ExcelsiorJet excelsiorJet = new ExcelsiorJet(jetHome) 71 | JetProject jetProject = createJetProject() 72 | new TestRunTask(excelsiorJet, jetProject).execute() 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/test/resources/25-windows-service-multiapp-with-excelsior-installer/src/main/java/SampleService.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | import java.text.*; 4 | import javax.swing.*; 5 | import java.awt.event.*; 6 | 7 | public class SampleService extends com.excelsior.service.WinService { 8 | private Object pauseLock = new Object(); 9 | private static DateFormat formatter = null; 10 | private volatile boolean paused = false; 11 | 12 | static { 13 | formatter = new SimpleDateFormat("HH:mm:ss dd MMM yyyy", Locale.getDefault()); 14 | formatter.setTimeZone(TimeZone.getDefault()); 15 | } 16 | 17 | public void run() { 18 | logInfoEvent("run() method called, service started"); 19 | 20 | for (; ; ) { 21 | if (paused) { 22 | 23 | // locking service run thread 24 | 25 | synchronized (pauseLock) { 26 | try { 27 | pauseLock.wait(); 28 | } catch (InterruptedException t) { 29 | } 30 | } 31 | } 32 | 33 | // working... 34 | 35 | logInfoEvent("service is working"); 36 | logInfoEvent("current date: " + formatter.format(new Date())); 37 | 38 | try { 39 | Thread.sleep(15000); 40 | } catch (InterruptedException t) { 41 | } 42 | } 43 | } 44 | 45 | public boolean init() { 46 | // things to do before service run 47 | 48 | logInfoEvent("init() method called, initializing service..."); 49 | 50 | for (String arg: getArgs()) { 51 | logInfoEvent(arg); 52 | } 53 | 54 | // set timeouts... 55 | 56 | setInitTimeout(1000); 57 | setPauseTimeout(1000); 58 | setResumeTimeout(1000); 59 | setStopTimeout(1000); 60 | 61 | logInfoEvent("service initialized"); 62 | 63 | return true; 64 | } 65 | 66 | public void shutdown() { 67 | // things to do before service shutdown 68 | } 69 | 70 | public void stop() { 71 | // things to do before service stop 72 | 73 | logInfoEvent("stop() method called, service is stopped"); 74 | } 75 | 76 | public void pause() { 77 | // things to do before service pause 78 | 79 | logInfoEvent("pause() method called, service is paused"); 80 | paused = true; 81 | } 82 | 83 | public void resume() { 84 | // things to do before service resume 85 | 86 | logInfoEvent("resume() method called, service is resumed"); 87 | paused = false; 88 | 89 | synchronized (pauseLock) { 90 | 91 | // unlocking service run thread 92 | pauseLock.notify(); 93 | } 94 | } 95 | 96 | 97 | public static void main(String args[]) { 98 | JFrame frame = new JFrame("HelloSwing"); 99 | frame.setSize(50, 50); 100 | JLabel label = new JLabel("Hello, Swing!", 0); 101 | frame.add(label); 102 | frame.addWindowListener(new WindowAdapter() { 103 | public void windowClosing(WindowEvent windowevent) { 104 | System.exit(0); 105 | } 106 | }); 107 | frame.show(); 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /maven.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration required to publish artifacts into maven local and maven central 3 | */ 4 | 5 | apply plugin: 'maven' 6 | apply plugin: 'signing' 7 | apply plugin: 'io.codearte.nexus-staging' 8 | apply plugin: 'net.researchgate.release' 9 | 10 | ext.githubRepoOwner = "excelsior-oss" 11 | ext.githubRepo = "excelsior-jet-gradle-plugin" 12 | 13 | task javadocJar(type: Jar, dependsOn: [javadoc, groovydoc]) { 14 | classifier = 'javadoc' 15 | from tasks.javadoc.destinationDir 16 | from tasks.groovydoc.destinationDir 17 | } 18 | 19 | task sourcesJar(type: Jar) { 20 | from sourceSets.main.allSource 21 | classifier = 'sources' 22 | } 23 | 24 | artifacts { 25 | archives jar 26 | archives javadocJar 27 | archives sourcesJar 28 | } 29 | 30 | signing { 31 | sign configurations.archives 32 | } 33 | 34 | // To run functional tests we need to install plugin to maven local, so it became available for test build script. 35 | // When signing plugin is applied it requires sonatype authentication data even for install into maven local. 36 | // So to run tests locally developer have to set sonatype authentication data, which is not always acceptable. 37 | // To work around this issue, we execute 'signArchives' task, only when 'uploadArchives' task is presented in task graph 38 | gradle.taskGraph.whenReady { 39 | signArchives.onlyIf { gradle.taskGraph.hasTask(":uploadArchives") } 40 | } 41 | 42 | uploadArchives { 43 | repositories { 44 | mavenDeployer { 45 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 46 | 47 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { 48 | if (!this.hasProperty("sonatypeUsername")) { 49 | logger.warn("[WARN] sonatypeUsername is not set!") 50 | ext.sonatypeUsername = "" 51 | } 52 | if (!this.hasProperty("sonatypePassword")) { 53 | logger.warn("[WARN] sonatypePassword is not set!") 54 | ext.sonatypePassword = "" 55 | } 56 | authentication(userName: sonatypeUsername, password: sonatypePassword) 57 | } 58 | 59 | pom.project { 60 | name 'Excelsior Jet Gradle Plugin' 61 | packaging 'jar' 62 | description ''' 63 | |Excelsior JET Gradle Plugin provides Gradle users with an easy way to compile their applications 64 | |down to optimized native Windows, OS X, or Linux executables with Excelsior JET.'''.stripMargin('|') 65 | url "https://github.com/${githubRepoOwner}/${githubRepo}" 66 | 67 | scm { 68 | url 'https://github.com/${githubRepoOwner}/${githubRepo}' 69 | connection 'scm:git:https://github.com/${githubRepoOwner}/${githubRepo}.git' 70 | developerConnection 'scm:git:https://github.com/${githubRepoOwner}/${githubRepo}.git' 71 | tag 'HEAD' 72 | } 73 | 74 | licenses { 75 | license { 76 | name 'GNU General Public License. 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.tasks.JetProject 25 | import com.excelsiorjet.api.util.Utils 26 | 27 | import static com.excelsiorjet.api.util.Txt.s 28 | 29 | /** 30 | * Base task for tasks that depend on build parameters of the plugin: 31 | * {@link JetBuildTask}, {@link JetProfileTask}, {@link JetRunTask), {@link JetCleanTask}. 32 | * 33 | * @see ExcelsiorJetExtension 34 | * 35 | * @author Aleksey Zhidkov 36 | * @author Nikita Lipsky 37 | */ 38 | abstract class AbstractBuildTask extends AbstractJetTask { 39 | 40 | @Override 41 | protected JetProject createJetProject() { 42 | JetProject result = super.createJetProject() 43 | checkDeprecated() 44 | return result 45 | } 46 | 47 | private void checkDeprecated() { 48 | ExcelsiorJetExtension ext = project.excelsiorJet as ExcelsiorJetExtension 49 | if (ext.getWinVIVersion() != null) { 50 | logger.warn(s("JetBuildTask.WinVIDeprecated.Warning", "winVIVersion", "version")) 51 | if (ext.windowsVersionInfo.version == null) { 52 | ext.windowsVersionInfo.version = ext.getWinVIVersion() 53 | } 54 | } 55 | if (ext.getWinVICopyright() != null) { 56 | logger.warn(s("JetBuildTask.WinVIDeprecated.Warning", "winVICopyright", "copyright")) 57 | if (ext.windowsVersionInfo.copyright == null) { 58 | ext.windowsVersionInfo.copyright = ext.getWinVICopyright() 59 | } 60 | } 61 | if (ext.getWinVIDescription() != null) { 62 | logger.warn(s("JetBuildTask.WinVIDeprecated.Warning", "winVIDescription", "description")) 63 | if (ext.windowsVersionInfo.description == null) { 64 | ext.windowsVersionInfo.description = ext.getWinVIDescription() 65 | } 66 | } 67 | if (!Utils.isEmpty(ext.getOptRtFiles())) { 68 | logger.warn(s("JetBuildTask.RTSettingDeprecated.Warning", "optRtFiles", "components =")) 69 | if (Utils.isEmpty(ext.runtime.components)) { 70 | ext.runtime.components = ext.getOptRtFiles() 71 | } 72 | } 73 | if (!Utils.isEmpty(ext.getLocales())) { 74 | logger.warn(s("JetBuildTask.RTSettingDeprecated.Warning", "locales", "locales =")) 75 | if (Utils.isEmpty(ext.runtime.locales)) { 76 | ext.runtime.locales = ext.getLocales() 77 | } 78 | } 79 | if (ext.getJavaRuntimeSlimDown().isDefined()) { 80 | logger.warn(s("JetBuildTask.RTSettingDeprecated.Warning", "javaRuntimeSlimDown", "slimDown {\n }")) 81 | if (!ext.runtime.slimDown.isDefined()) { 82 | ext.runtime.slimDown = ext.getJavaRuntimeSlimDown() 83 | } 84 | } 85 | if (ext.getProfile() != null) { 86 | logger.warn(s("JetBuildTask.RTSettingDeprecated.Warning", "profile", "profile =")) 87 | if (ext.runtime.profile == null) { 88 | ext.runtime.profile = ext.getProfile() 89 | } 90 | } 91 | 92 | if (ext.getExecProfilesDir() != null) { 93 | logger.warn(s("JetBuildTask.ExecProfilesDeprecated.Warning", "execProfilesDir", "outputDir =")); 94 | if (ext.execProfiles.outputDir == null) { 95 | ext.execProfiles.outputDir = ext.getExecProfilesDir(); 96 | } 97 | } 98 | if (ext.getExecProfilesName() != null) { 99 | logger.warn(s("JetBuildTask.ExecProfilesDeprecated.Warning", "execProfilesName", "outputName =")); 100 | if (ext.execProfiles.outputName == null) { 101 | ext.execProfiles.outputName = ext.getExecProfilesName(); 102 | } 103 | } 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/main/resources/com/excelsiorjet/gradle/plugin/GradleStrings.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2015, Excelsior LLC. 3 | # 4 | # This file is part of Excelsior JET Gradle Plugin. 5 | # 6 | # Excelsior JET Gradle Plugin is free software: 7 | # you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with Excelsior JET Gradle Plugin. 19 | # If not, see . 20 | # 21 | ExcelsiorJetGradlePlugin.ProjectVersionIsNotSet = 'Project "version" parameter is not set. "1.0" was used as default.' 22 | ExcelsiorJetGradlePlugin.ProjectGroupIsGuessed = 'Project "group" parameter is not set. "{0}" is used instead.' 23 | ExcelsiorJetGradlePlugin.NoJarOrWarPluginsFound = 'The Excelsior JET Gradle plugin requires the \'java\' or \'war\' plugins to be applied beforehand' 24 | JetHome.JetNotFound.Error = '\ 25 | Could not find a suitable Excelsior JET installation by exploring the executable search path.\n\ 26 | Please make sure that you have Excelsior JET 11 or greater version installed.\n\ 27 | If you do not want it to appear in the PATH environment variable,\n\ 28 | pass the full pathname of your Excelsior JET installation directory to Gradle\n\ 29 | by setting either the "JET_HOME" environment variable,\n\ 30 | the "jet.home" system property on the Gradle command-line,\n\ 31 | or the "jetHome" parameter of "excelsiorJet'{}'" extension in your "build.gradle" file.\ 32 | ' 33 | JetApi.MainJarNotFound.Failure = 'Jar {0} was not found. \ 34 | Please configure the "mainJar" parameter of "excelsiorJet'{}'" extension.' 35 | JetApi.MainWarNotFound.Failure = 'War {0} was not found. \ 36 | Please configure the "mainWar" parameter of "excelsiorJet'{}'" extension.' 37 | JetApi.MainNotSpecified.Failure = 'Main class not specified. Please set the "mainClass" parameter of "excelsiorJet'{}'" extension' 38 | JetApi.TomcatNotSpecified.Failure = 'Master Tomcat application server location not specified. \ 39 | Please set the "tomcatHome" parameter of "tomcat'{}'" of "excelsiorJet'{}'" extension or the "-Dtomcat.home" argument of "gradlew" command' 40 | JetApi.NoTestRun.Failure = 'Global Optimizer and Java Runtime Slim-Down require a Test Run to be performed before the build. \ 41 | Please run the "jetTestRun" Gradle task to perform a Test Run' 42 | JetApi.Package.Eula.EncodingDoesNotMatchActual = 'eula file is in "{0}" encoding, while in build.gradle "{1}" encoding is specified' 43 | JetApi.NoIconForOSXAppBundle.Warning = 'Icon file "{0}" does not exist. \ 44 | Please place the OS X icon for your application at that location or edit the "icon" parameter of\ 45 | "osxBundle'{}'" of "excelsiorJet'{}'" extension.' 46 | JetBuildTask.NoDeveloperId.Warning = '"developerId" configuration parameter is missing in "osxBundle'{}'". \ 47 | The parameter is required to sign the OS X application bundle. You may also set it via the "-Dosx.developer.id"\ 48 | argument of the "gradlew" command. It is recommended to set the parameter \ 49 | because unsigned application bundles may refuse to launch on some OS X systems' 50 | JetBuildTask.NoPublisherId.Warning = '"publisherId" configuration parameter is missing in "osxBundle'{}'". \ 51 | The parameter is required to create the OS X installer package (.pkg). You may also set the parameter via the \ 52 | "-Dosx.publisher.id" argument of the "gradlew" command.' 53 | JetApi.DuplicateFileName = 'The following dependencies have the same file name, but different contents: {0}. Only the first one will be compiled.' 54 | JetBuildTask.WinVIDeprecated.Warning = 'Parameter "{0}" is deprecated. Use "windowsVersionInfo.{1}" parameter instead.' 55 | JetBuildTask.RTSettingDeprecated.Warning = Parameter "{0}" is deprecated. Use \nruntime '{'\n {1}\n'}'\ninstead. 56 | JetBuildTask.ExecProfilesDeprecated.Warning = Parameter "{0}" is deprecated. Use \nexecProfiles '{'\n {1}\n'}'\ninstead. 57 | JetApi.TestRun.RecollectProfile.Warning = 'The startup profile is {0} days old. \ 58 | It is recommended to perform jetTestRun to renew it' 59 | JetApi.PGO.RecollectProfile.Warning = 'The execution profile is {0} old. \ 60 | It is recommended to perform jetProfile to renew it' 61 | JetApi.SpringBoot.ArchiveIsNotSpringBootArchive.Failure = File "{0}" is not a Spring Boot jar or war file. \n\ 62 | Please make sure that your "build.gradle" script enables the Spring Boot Gradle plugin. 63 | JetProject.NoAppType.Failure = '"appType" parameter is not set. \n\ 64 | Please set "appType" parameter to "tomcat" if the resulting war file is intended to run within Tomcat application server, \ 65 | or to "spring-boot" if the war file is intended to run as a Spring Boot executable war.' 66 | StopTask.NoRunApp.Error = Failed to stop the application. Was it run by the Excelsior JET Gradle plugin? 67 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /src/main/groovy/com/excelsiorjet/gradle/plugin/AbstractJetTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2017 Excelsior LLC. 3 | * 4 | * This file is part of Excelsior JET Gradle Plugin. 5 | * 6 | * Excelsior JET Gradle Plugin is free software: 7 | * you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Excelsior JET Gradle Plugin is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Excelsior JET Gradle Plugin. 19 | * If not, see . 20 | * 21 | */ 22 | package com.excelsiorjet.gradle.plugin 23 | 24 | import com.excelsiorjet.api.tasks.config.ApplicationType 25 | import com.excelsiorjet.api.tasks.JetProject 26 | import com.excelsiorjet.api.tasks.JetTaskFailureException 27 | import com.excelsiorjet.api.tasks.config.dependencies.ProjectDependency 28 | import com.excelsiorjet.api.util.Txt 29 | import org.gradle.api.DefaultTask 30 | 31 | import java.security.MessageDigest 32 | 33 | import static com.excelsiorjet.api.util.Txt.s 34 | 35 | /** 36 | * Base class for ExcelsiorJet plugin tasks. 37 | * 38 | * @author Aleksey Zhidkov 39 | */ 40 | abstract class AbstractJetTask extends DefaultTask { 41 | /** 42 | * The plugin name. Must be synchronized with the actual version of the plugin. 43 | * TODO: retrieve plugin version from binary meta-data if possible. 44 | */ 45 | static private final String PLUGIN_NAME = "Excelsior JET Gradle plugin v1.3.1" 46 | 47 | @Lazy String jetHome = (project.excelsiorJet as ExcelsiorJetExtension).jetHome 48 | 49 | protected JetProject createJetProject() { 50 | ExcelsiorJetExtension ext = project.excelsiorJet as ExcelsiorJetExtension 51 | validateSettings() 52 | def jetProject = new JetProject(PLUGIN_NAME, project.name, ext.getGroupId(), ext.getVersion(), 53 | JetProject.checkAndGetAppType(ext.appType), project.buildDir, ext.getJetResourcesDir()) 54 | 55 | // getters should be used to fallback into convention mapping magic, when field is not set 56 | jetProject.projectDependencies(getDependencies()) 57 | .excelsiorJetPackaging(ext.getPackaging()) 58 | .artifactName(ext.getArtifactName()) 59 | .jetOutputDir(ext.getJetOutputDir()) 60 | .jetBuildDir(ext.getJetBuildDir()) 61 | .jetAppDir(ext.getJetAppDir()) 62 | .mainClass(ext.getMainClass()) 63 | .mainJar(ext.getMainJar()) 64 | .mainWar(ext.getMainWar()) 65 | .outputName(ext.getOutputName()) 66 | .packageFilesDir(ext.getPackageFilesDir()) 67 | .packageFiles(ext.getPackageFiles()) 68 | .version(ext.getVersion()) 69 | .hideConsole(ext.getHideConsole()) 70 | .icon(ext.getIcon()) 71 | .splash(ext.getSplash()) 72 | .inlineExpansion(ext.getInlineExpansion()) 73 | .stackAllocation(ext.getStackAllocation()) 74 | .stackTraceSupport(ext.getStackTraceSupport()) 75 | .execProfiles(ext.getExecProfiles()) 76 | .jvmArgs(ext.getJvmArgs()) 77 | .addWindowsVersionInfo(ext.getAddWindowsVersionInfo()) 78 | .windowsVersionInfoConfiguration(ext.getWindowsVersionInfo()) 79 | .inceptionYear(ext.getInceptionYear()) 80 | .vendor(ext.getVendor()) 81 | .product(ext.getProduct()) 82 | .excelsiorInstallerConfiguration(ext.getExcelsiorInstaller()) 83 | .windowsServiceConfiguration(ext.getWindowsService()) 84 | .globalOptimizer(ext.getGlobalOptimizer()) 85 | .runtimeConfiguration(ext.getRuntime()) 86 | .trialVersion(ext.getTrialVersion()) 87 | .osxBundleConfiguration(ext.getOsxBundle()) 88 | .multiApp(ext.getMultiApp()) 89 | .profileStartup(ext.getProfileStartup()) 90 | .profileStartupTimeout(ext.getProfileStartupTimeout()) 91 | .protectData(ext.getProtectData()) 92 | .cryptSeed(ext.getCryptSeed()) 93 | .compilerOptions(ext.getCompilerOptions()) 94 | .tomcatConfiguration(ext.getTomcat()) 95 | .runArgs(ext.getRunArgs()) 96 | .multiAppRunArgs(ext.getMultiAppRunArgs()) 97 | .dependencies(ext.getDependencies()) 98 | .optimizationPreset(ext.getOptimizationPreset()) 99 | .pdbConfiguration(ext.getPdb()) 100 | .terminationPolicy(ext.getTerminationPolicy()) 101 | 102 | return jetProject 103 | } 104 | 105 | private List getDependencies() { 106 | ExcelsiorJetExtension ext = project.excelsiorJet as ExcelsiorJetExtension 107 | if (ext.getIgnoreProjectDependencies()) { 108 | return Collections.emptyList(); 109 | } 110 | 111 | // due to bug in support of maven relocation in gradle, it's not merges the same artifact referenced by different names 112 | // https://issues.gradle.org/browse/GRADLE-2812 113 | // https://issues.gradle.org/browse/GRADLE-3301 114 | // https://discuss.gradle.org/t/oddity-in-the-output-of-dependencyinsight-task/7553/12 115 | // https://discuss.gradle.org/t/warning-after-gradle-update-1-9-with-pmd-plugin/1731/3 116 | def configuration = project.configurations.getByName("runtime") 117 | def allDependencies = configuration.getResolvedConfiguration().getResolvedArtifacts().collect() { 118 | def module = it.moduleVersion.id.module 119 | return new ProjectDependency(module.group, module.name, it.moduleVersion.id.version, it.file, false) 120 | } 121 | //configuration may also have dependencies that were added with "files" or "fileSet" parameters. Let's handle them also. 122 | def addedAsFiles = configuration.collect() - configuration.getResolvedConfiguration().getResolvedArtifacts().collect()*.file 123 | addedAsFiles.each { 124 | allDependencies.add(new ProjectDependency(null, null, null, it as File, false)) 125 | } 126 | def duplicatesByName = allDependencies.groupBy { it.path.name } 127 | duplicatesByName.values(). 128 | findAll { it.size() > 1 && it.collect({ AbstractJetTask.hash(it.path) }).size() > 1 }. 129 | each { 130 | logger.warn(Txt.s("JetApi.DuplicateFileName", it.collect { it.idStr(true) })) 131 | } 132 | return duplicatesByName.values().collect { it.first() } 133 | } 134 | 135 | private static String hash(File file) { 136 | def digest = MessageDigest.getInstance("SHA1") 137 | file.eachByte(4096) { buffer, length -> 138 | digest.update(buffer, 0, length) 139 | } 140 | return digest.digest().encodeHex() as String 141 | } 142 | 143 | private void validateSettings() { 144 | ExcelsiorJetExtension ext = project.excelsiorJet as ExcelsiorJetExtension 145 | if (ext.getAppType() == ApplicationType.TOMCAT.toString()) { 146 | if (ext.getIgnoreProjectDependencies()) { 147 | throw new JetTaskFailureException(s("JetApi.IgnoreProjectDependenciesShouldNotBeSetForTomcatApplications")); 148 | } 149 | } 150 | } 151 | 152 | } 153 | --------------------------------------------------------------------------------