From c7fc964d9c37b2f0948ec784ffc368a2adba2b04 Mon Sep 17 00:00:00 2001 From: jianglai Date: Mon, 10 Dec 2018 09:02:31 -0800 Subject: [PATCH] Add a Gradle task to build the nomulus tool It'd be nice if we can separate out the tool to its own package and reduce the transitive dependencies that it pulls in. However since the entire core project is a dependency of the tool, it doesn't make any difference as we'd be pulling in core and all its transitive dependencies as well. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=224821931 --- gradle/build.gradle | 7 ++++++- gradle/core/build.gradle | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/gradle/build.gradle b/gradle/build.gradle index 4adb4af10..ec8f25e54 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -44,8 +44,13 @@ subprojects { mavenCentral() } + def services = [':services:default', + ':services:backend', + ':services:tools', + ':services:pubapi'] + // Set up all of the deployment projects. - if (project.name in ['default', 'backend', 'tools', 'pubapi']) { + if (services.contains(project.path)) { apply plugin: 'war' diff --git a/gradle/core/build.gradle b/gradle/core/build.gradle index 19c226b8d..585b40a04 100644 --- a/gradle/core/build.gradle +++ b/gradle/core/build.gradle @@ -444,3 +444,24 @@ test { maxParallelForks 5 }.dependsOn(fragileTest, outcastTest) +task nomulus(type: Jar) { + manifest { + attributes 'Main-Class': 'google.registry.tools.RegistryTool' + } + zip64 = true + baseName = 'nomulus' + version = null + from { + configurations.runtimeClasspath.collect { + it.isDirectory() ? it : zipTree(it) + } + } + // Excludes signature files that accompany some dependency jars, like + // bonuncycastle. It they are present, only classes from those signed jars are + // made available to the class loader. + // see https://discuss.gradle.org/t/signing-a-custom-gradle-plugin-thats-downloaded-by-the-build-system-from-github/1365 + exclude "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA" + with jar + dependsOn project(':third_party').jar +} +