| 
									
										
										
										
											2021-05-11 15:41:42 -07:00
										 |  |  | plugins { | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  |   id 'scala' | 
					
						
							| 
									
										
										
										
											2023-12-15 13:28:33 -06:00
										 |  |  |   id 'org.gradle.playframework' | 
					
						
							| 
									
										
										
										
											2021-05-11 15:41:42 -07:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-12-10 23:24:43 +05:30
										 |  |  | apply from: '../gradle/versioning/versioning.gradle' | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | apply from: './play.gradle' | 
					
						
							| 
									
										
										
										
											2024-12-10 23:24:43 +05:30
										 |  |  | apply from: '../gradle/coverage/java-coverage.gradle' | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  | apply from: '../gradle/docker/docker.gradle' | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  | ext { | 
					
						
							|  |  |  |   docker_repo = 'datahub-frontend-react' | 
					
						
							|  |  |  |   docker_dir = 'datahub-frontend' | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-05-11 15:41:42 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-28 09:05:16 -05:00
										 |  |  | java { | 
					
						
							|  |  |  |   toolchain { | 
					
						
							|  |  |  |     languageVersion = JavaLanguageVersion.of(jdkVersion(project)) | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-12-10 23:24:43 +05:30
										 |  |  | test { | 
					
						
							|  |  |  |   jacoco { | 
					
						
							|  |  |  |     // jacoco instrumentation is failing when dealing with code of this dependency, excluding it.
 | 
					
						
							|  |  |  |     excludes = ["com/gargoylesoftware/**"] | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | model { | 
					
						
							|  |  |  |   // Must specify the dependency here as "stage" is added by rule based model.
 | 
					
						
							|  |  |  |   tasks.myTar { | 
					
						
							|  |  |  |     dependsOn stage | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | task myTar(type: Tar) { | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  |   compression = Compression.NONE | 
					
						
							| 
									
										
										
										
											2019-08-31 20:51:14 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   from("${buildDir}/stage") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   into("bin") { | 
					
						
							|  |  |  |     from("bin") | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   into("conf") { | 
					
						
							|  |  |  |     from("conf") | 
					
						
							|  |  |  |     fileMode = 0600 | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | artifacts { | 
					
						
							|  |  |  |   archives myTar | 
					
						
							| 
									
										
										
										
											2021-05-11 15:41:42 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-10 18:15:53 -05:00
										 |  |  | /* | 
					
						
							|  |  |  | PLAY UPGRADE NOTE | 
					
						
							|  |  |  | Generates the distribution jars under the expected names. The playFramework plugin only accepts certain name values | 
					
						
							|  |  |  | for the resulting folders and files, so some changes were made to accommodate. Default distribution is main if these are excluded | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | distributions { | 
					
						
							|  |  |  |   create("datahub-frontend") { | 
					
						
							|  |  |  |     distributionBaseName = project.ext.playBinaryBaseName | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   playBinary { | 
					
						
							|  |  |  |     distributionBaseName = project.ext.playBinaryBaseName | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  | task unversionZip(type: Copy, dependsOn: [':datahub-web-react:distZip', distZip]) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   from ("${buildDir}/distributions") | 
					
						
							|  |  |  |   include "datahub-frontend-${version}.zip" | 
					
						
							|  |  |  |   into "${buildDir}/distributions" | 
					
						
							|  |  |  |   rename "datahub-frontend-${version}.zip", "datahub-frontend.zip" | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  | docker { | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  |   dependsOn(stageMainDist) | 
					
						
							| 
									
										
										
										
											2025-04-07 10:13:07 +05:30
										 |  |  |   name "${docker_registry}/${docker_repo}:${versionTag}" | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  |   dockerfile file("${rootProject.projectDir}/docker/${docker_dir}/Dockerfile") | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  |   files "${buildDir}/stage" | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  |   files fileTree(rootProject.projectDir) { | 
					
						
							| 
									
										
										
										
											2023-11-13 16:26:53 -06:00
										 |  |  |     include '.dockerignore' | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  |     include 'docker/monitoring/*' | 
					
						
							|  |  |  |     include "docker/${docker_dir}/*" | 
					
						
							| 
									
										
										
										
											2023-08-17 00:10:17 -05:00
										 |  |  |   }.exclude { | 
					
						
							| 
									
										
										
										
											2023-11-13 16:26:53 -06:00
										 |  |  |     i -> (!i.file.name.endsWith(".dockerignore") && i.file.isHidden()) | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2025-04-02 11:51:10 +05:30
										 |  |  |   additionalTag("Debug", "${docker_registry}/${docker_repo}:debug") | 
					
						
							| 
									
										
										
										
											2023-11-28 21:52:11 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Add build args if they are defined (needed for some CI or enterprise environments)
 | 
					
						
							|  |  |  |   def dockerBuildArgs = [:] | 
					
						
							|  |  |  |   if (project.hasProperty('alpineApkRepositoryUrl')) { | 
					
						
							|  |  |  |     dockerBuildArgs.ALPINE_REPO_URL = project.getProperty('alpineApkRepositoryUrl') | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   if (project.hasProperty('githubMirrorUrl')) { | 
					
						
							|  |  |  |     dockerBuildArgs.GITHUB_REPO_URL = project.getProperty('githubMirrorUrl') | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   if (project.hasProperty('mavenCentralRepositoryUrl')) { | 
					
						
							|  |  |  |     dockerBuildArgs.MAVEN_CENTRAL_REPO_URL = project.getProperty('mavenCentralRepositoryUrl') | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if (dockerBuildArgs.size() > 0) { | 
					
						
							|  |  |  |     buildArgs(dockerBuildArgs) | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2022-12-26 10:09:08 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-15 13:28:33 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | // gradle 8 fixes
 | 
					
						
							|  |  |  | tasks.getByName('createDatahub-frontendTarDist').dependsOn 'stageMainDist' | 
					
						
							|  |  |  | tasks.getByName('createDatahub-frontendZipDist').dependsOn 'stageMainDist' | 
					
						
							|  |  |  | stagePlayBinaryDist.dependsOn tasks.getByName('createDatahub-frontendStartScripts') | 
					
						
							|  |  |  | playBinaryDistTar.dependsOn tasks.getByName('createDatahub-frontendStartScripts') | 
					
						
							|  |  |  | playBinaryDistZip.dependsOn tasks.getByName('createDatahub-frontendStartScripts') | 
					
						
							|  |  |  | tasks.getByName('stageDatahub-frontendDist').dependsOn stagePlayBinaryDist | 
					
						
							|  |  |  | tasks.getByName('stageDatahub-frontendDist').dependsOn createPlayBinaryStartScripts | 
					
						
							|  |  |  | tasks.getByName('datahub-frontendDistTar').dependsOn createPlayBinaryStartScripts | 
					
						
							|  |  |  | tasks.getByName('datahub-frontendDistTar').dependsOn createMainStartScripts | 
					
						
							|  |  |  | tasks.getByName('datahub-frontendDistZip').dependsOn createPlayBinaryStartScripts | 
					
						
							|  |  |  | tasks.getByName('datahub-frontendDistZip').dependsOn createMainStartScripts | 
					
						
							|  |  |  | playBinaryDistTar.dependsOn createMainStartScripts | 
					
						
							|  |  |  | playBinaryDistZip.dependsOn createMainStartScripts | 
					
						
							|  |  |  | createMainStartScripts.dependsOn 'stageDatahub-frontendDist' | 
					
						
							|  |  |  | createPlayBinaryTarDist.dependsOn 'stageDatahub-frontendDist' | 
					
						
							|  |  |  | createPlayBinaryZipDist.dependsOn 'stageDatahub-frontendDist' | 
					
						
							|  |  |  | createPlayBinaryTarDist.dependsOn 'stageMainDist' | 
					
						
							|  |  |  | createPlayBinaryZipDist.dependsOn 'stageMainDist' |