Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use one multi-module gradle build #1791

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ env:
- TERM=dumb # for gradle

install: true
script:
- (cd jib-core; ./gradlew --stacktrace build)
- (cd jib-plugins-common; ./gradlew --stacktrace build)
- (cd jib-gradle-plugin; ./gradlew --stacktrace build)
# unset _JAVA_OPTIONS to avoid spurious test failures
- (cd jib-maven-plugin; unset _JAVA_OPTIONS; ./mvnw -B verify -U)
script: ./gradlew build -s

# cobbled together from
# https://docs.travis-ci.com/user/languages/java/#projects-using-gradle
Expand Down
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
allprojects {
group 'com.google.cloud.tools'

repositories {
mavenCentral()
}
}

subprojects {
plugins.withId("java") {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'

jar.manifest.attributes(
'Implementation-Version': version
)
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion jib-gradle-plugin/gradlew → gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion jib-gradle-plugin/gradlew.bat → gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
23 changes: 2 additions & 21 deletions jib-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ plugins {
// For release.
id 'maven'
id 'net.researchgate.release' version '2.7.0'
}

group 'com.google.cloud.tools'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'

repositories {
mavenCentral()
id "io.freefair.maven-jars" version "2.9.5"
}

sourceSets {
Expand Down Expand Up @@ -64,7 +55,6 @@ dependencies {

jar {
manifest {
attributes 'Implementation-Version': version
attributes 'Automatic-Module-Name': 'com.google.cloud.tools.jib'

// OSGi metadata
Expand Down Expand Up @@ -140,15 +130,6 @@ checkstyle {
/* CHECKSTYLE */

/* RELEASE */
task sourceJar(type: Jar) {
from sourceSets.main.allJava
classifier 'sources'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier 'javadoc'
}

task writePom {
project.afterEvaluate {
Expand Down Expand Up @@ -213,7 +194,7 @@ task writePom {
// For Kokoro sign and releases
task prepareRelease(type: Copy) {
from jar
from sourceJar
from sourcesJar
from javadocJar
from writePom
into "${project.buildDir}/release-artifacts"
Expand Down
Binary file removed jib-core/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions jib-core/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

172 changes: 0 additions & 172 deletions jib-core/gradlew

This file was deleted.

Loading