| 
									
										
										
										
											2024-05-09 14:56:03 -05:00
										 |  |  | plugins { | 
					
						
							|  |  |  |   id 'java-library' | 
					
						
							|  |  |  |   id 'com.github.johnrengelman.shadow' | 
					
						
							|  |  |  |   id 'signing' | 
					
						
							|  |  |  |   id 'io.codearte.nexus-staging' | 
					
						
							|  |  |  |   id 'maven-publish' | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | apply from: "../versioning.gradle" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | jar.enabled = false // Since we only want to build shadow jars, disabling the regular jar creation
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // only include since required registry file
 | 
					
						
							|  |  |  | processResources { | 
					
						
							|  |  |  |   from("${project(':metadata-models').projectDir}/src/main/resources/entity-registry.yml") | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | dependencies { | 
					
						
							|  |  |  |   // Required for custom code plugins
 | 
					
						
							|  |  |  |   api(project(':entity-registry')) { | 
					
						
							|  |  |  |     // only include dataTemplate (and resources/entity-registry.yml from above)
 | 
					
						
							|  |  |  |     exclude module: 'metadata-models' | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   implementation project(path: ':metadata-models', configuration: 'dataTemplate') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Required for MCL/MCP hooks
 | 
					
						
							|  |  |  |   implementation(project(':metadata-io:metadata-io-api')) { | 
					
						
							|  |  |  |     transitive = false | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // utility classes
 | 
					
						
							|  |  |  |   implementation(project(':metadata-utils')) { | 
					
						
							|  |  |  |     transitive = false | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | configurations.all { | 
					
						
							|  |  |  |   exclude group: 'org.antlr' | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-03 16:55:59 -05:00
										 |  |  | task sourcesJar(type: Jar) { | 
					
						
							|  |  |  |   archiveClassifier = 'sources' | 
					
						
							|  |  |  |   from sourceSets.main.allSource | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | task javadocJar(type: Jar) { | 
					
						
							|  |  |  |   archiveClassifier = 'javadoc' | 
					
						
							|  |  |  |   from javadoc | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-09 14:56:03 -05:00
										 |  |  | shadowJar { | 
					
						
							|  |  |  |   zip64 = true | 
					
						
							|  |  |  |   archiveClassifier = '' | 
					
						
							|  |  |  |   // preventing java multi-release JAR leakage
 | 
					
						
							|  |  |  |   // https://github.com/johnrengelman/shadow/issues/729
 | 
					
						
							|  |  |  |   exclude('module-info.class', 'META-INF/versions/**', | 
					
						
							|  |  |  |       '**/LICENSE', '**/LICENSE*.txt', '**/NOTICE', '**/NOTICE.txt', 'licenses/**', 'log4j2.*', 'log4j.*') | 
					
						
							|  |  |  |   relocate 'com.fasterxml.jackson', 'datahub.shaded.jackson' | 
					
						
							|  |  |  |   mergeServiceFiles() | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | publishing { | 
					
						
							|  |  |  |   publications { | 
					
						
							|  |  |  |     shadow(MavenPublication) { publication -> | 
					
						
							|  |  |  |       project.shadow.component(publication) | 
					
						
							|  |  |  |       pom { | 
					
						
							|  |  |  |         name = 'DataHub Custom Plugin Dependency' | 
					
						
							|  |  |  |         group = 'io.acryl' | 
					
						
							|  |  |  |         artifactId = 'datahub-custom-plugin-lib' | 
					
						
							|  |  |  |         description = 'DataHub Java Custom Plugin dependencies' | 
					
						
							|  |  |  |         url = 'https://datahubproject.io' | 
					
						
							| 
									
										
										
										
											2024-07-03 16:55:59 -05:00
										 |  |  |         artifacts = [shadowJar, javadocJar, sourcesJar] | 
					
						
							| 
									
										
										
										
											2024-05-09 14:56:03 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |         scm { | 
					
						
							|  |  |  |           connection = 'scm:git:git://github.com/datahub-project/datahub.git' | 
					
						
							|  |  |  |           developerConnection = 'scm:git:ssh://github.com:datahub-project/datahub.git' | 
					
						
							|  |  |  |           url = 'https://github.com/datahub-project/datahub.git' | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         licenses { | 
					
						
							|  |  |  |           license { | 
					
						
							|  |  |  |             name = 'The Apache License, Version 2.0' | 
					
						
							|  |  |  |             url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         developers { | 
					
						
							|  |  |  |           developer { | 
					
						
							|  |  |  |             id = 'datahub' | 
					
						
							|  |  |  |             name = 'Datahub' | 
					
						
							|  |  |  |             email = 'datahub@acryl.io' | 
					
						
							|  |  |  |           } | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   repositories { | 
					
						
							| 
									
										
										
										
											2024-05-23 07:32:22 -05:00
										 |  |  |     maven { | 
					
						
							| 
									
										
										
										
											2024-05-09 14:56:03 -05:00
										 |  |  |       def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | 
					
						
							|  |  |  |       def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" | 
					
						
							|  |  |  |       def ossrhUsername = System.getenv('RELEASE_USERNAME') | 
					
						
							|  |  |  |       def ossrhPassword = System.getenv('RELEASE_PASSWORD') | 
					
						
							|  |  |  |       credentials { | 
					
						
							|  |  |  |         username ossrhUsername | 
					
						
							|  |  |  |         password ossrhPassword | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | 
					
						
							| 
									
										
										
										
											2024-05-23 07:32:22 -05:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-05-09 14:56:03 -05:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | signing { | 
					
						
							|  |  |  |   required { gradle.taskGraph.hasTask("publish") } | 
					
						
							|  |  |  |   def signingKey = findProperty("signingKey") | 
					
						
							|  |  |  |   def signingPassword = System.getenv("SIGNING_PASSWORD") | 
					
						
							|  |  |  |   useInMemoryPgpKeys(signingKey, signingPassword) | 
					
						
							|  |  |  |   sign publishing.publications.shadow | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | nexusStaging { | 
					
						
							|  |  |  |   serverUrl = "https://s01.oss.sonatype.org/service/local/" | 
					
						
							|  |  |  |   //required only for projects registered in Sonatype after 2021-02-24
 | 
					
						
							|  |  |  |   username = System.getenv("NEXUS_USERNAME") | 
					
						
							|  |  |  |   password = System.getenv("NEXUS_PASSWORD") | 
					
						
							|  |  |  | } |