Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 315364732
Change-Id: I243b8f6badcd71c3f9835c160f6476098e055e2d
  • Loading branch information
magl0 authored and copybara-github committed Jun 8, 2020
1 parent eaa9954 commit c1b1422
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 4 deletions.
80 changes: 79 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ plugins {

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: "signing"

apply plugin: 'net.ltgt.errorprone'

Expand Down Expand Up @@ -103,6 +104,9 @@ subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8

java.withJavadocJar()
java.withSourcesJar()

jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,
Expand Down Expand Up @@ -130,4 +134,78 @@ subprojects {
maxHeapSize = '1500m'
}
}

plugins.withId('maven-publish') {
publishing {
publications {
maven(MavenPublication) {
from components.java

pom {
name = project.group + ':' + project.name
url = 'https://github.com/google/tsunami-security-scanner'
afterEvaluate {
// description is not available until evaluated.
description = project.description
}

licenses {
license {
name = 'Apache 2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
}
}

scm {
connection = 'scm:git:https://github.com/google/tsunami-security-scanner.git'
developerConnection = 'scm:git:git@github.com:google/tsunami-security-scanner.git'
url = 'https://github.com/google/tsunami-security-scanner'
}

developers {
developer {
id = 'com.google.tsunami'
name = 'Tsunami Contributors'
email = 'tsunami-security-scanner@googlegroups.com'
url = 'https://github.com/google/tsunami-security-scanner'
organization = 'Tsunami Authors'
organizationUrl = 'https://www.google.com'
}
}
}
}
}
repositories {
maven {
def stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def releaseUrl = stagingUrl
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
credentials {
if (rootProject.hasProperty('ossrhUsername')
&& rootProject.hasProperty('ossrhPassword')) {
username = rootProject.ossrhUsername
password = rootProject.ossrhPassword
}
}
}
mavenLocal()
}
}

signing {
required false
sign publishing.publications.maven
}

plugins.withId('com.github.johnrengelman.shadow') {
publishing {
publications {
maven {
artifact project.tasks.shadowJar
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions docs/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ following command:
```

When the command finishes, the generated scanner `jar` file is located in the
`main/build/libs` folder with the name of `tsunami-cli-[version]-all.jar`. This
`main/build/libs` folder with the name of `tsunami-main-[version]-cli.jar`. This
is a fat jar file so can be treated as a standalone binary.

To execute the scanner, first you need to install plugins into a chosen folder.
Expand All @@ -36,7 +36,7 @@ the following command to execute a Tsunami scan:
```shell
java \
# Tsunami classpath, as of now plugins must be installed into classpath.
-cp "tsunami-cli.jar:~/tsunami-plugins/*" \
-cp "tsunami-main-[version]-cli.jar:~/tsunami-plugins/*" \
# Specify the config file of Tsunami, by default Tsunami loads a tsunami.yaml
# file from there the command is executed.
-Dtsunami.config.location=/path/to/config/tsunami.yaml \
Expand Down
2 changes: 1 addition & 1 deletion main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ application {
}

shadowJar {
baseName = 'tsunami-cli'
classifier = 'cli'
exclude '*.proto'
}

0 comments on commit c1b1422

Please sign in to comment.