[
https://issues.apache.org/jira/browse/BEAM-3443?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16319491#comment-16319491
]
ASF GitHub Bot commented on BEAM-3443:
--------------------------------------
lukecwik closed pull request #4374: [BEAM-3443] Support a sandbox build for
running demos/hacking on a plane.
URL: https://github.com/apache/beam/pull/4374
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.gitignore b/.gitignore
index 2b9951a88f4..00b57a382f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,9 @@
# is an input to 'maven-assembly-plugin' that generates source distribution.
# This is typically in files named 'src.xml' throughout this repository.
+# Ignore any offline repositories the user may have created.
+**/offline-repository/**/*
+
# Ignore files generated by the Gradle build process.
**/.gradle/**/*
**/.gogradle/**/*
diff --git a/build.gradle b/build.gradle
index ea19fac7e8d..e34007e5b4e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -152,6 +152,17 @@ ext.library = [
// fetch and enable plugins.
buildscript {
repositories {
+ maven { url offlineRepositoryRoot }
+
+ // To run gradle in offline mode, one must first invoke
+ // 'updateOfflineRepository' to create an offline repo
+ // inside the root project directory. See the application
+ // of the offline repo plugin within build_rules.gradle
+ // for further details.
+ if (gradle.startParameter.isOffline()) {
+ return
+ }
+
mavenLocal()
mavenCentral()
jcenter()
@@ -159,17 +170,18 @@ buildscript {
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
- classpath "net.ltgt.gradle:gradle-apt-plugin:0.12"
// Enable a Java annotation processor
- classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.1"
// Enable proto code generation
- classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
// Enable provided and optional configurations
- classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"
// Enable Apache license enforcement
- classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0"
// Enable Avro code generation
- classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0"
// Enable a code formatting plugin
- classpath "gradle.plugin.com.github.blindpirate:gogradle:0.7.0"
// Enable Go code compilation
- classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0"
// Enable building Docker containers
- classpath "cz.malohlava:visteg:1.0.3"
// Enable generating Gradle task dependencies as ".dot" files
- classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
// Enable shading Java dependencies
- classpath "ca.coglinc:javacc-gradle-plugin:2.4.0"
// Enable the JavaCC parser generator
+ classpath "net.ltgt.gradle:gradle-apt-plugin:0.12"
// Enable a Java annotation processor
+ classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.1"
// Enable proto code generation
+ classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
// Enable provided and optional configurations
+ classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"
// Enable Apache license enforcement
+ classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0"
// Enable Avro code generation
+ classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0"
// Enable a code formatting plugin
+ classpath "gradle.plugin.com.github.blindpirate:gogradle:0.7.0"
// Enable Go code compilation
+ classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0"
// Enable building Docker containers
+ classpath "cz.malohlava:visteg:1.0.3"
// Enable generating Gradle task dependencies as
".dot" files
+ classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
// Enable shading Java dependencies
+ classpath "ca.coglinc:javacc-gradle-plugin:2.4.0"
// Enable the JavaCC parser generator
+ classpath
"gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.3"
// Enable creating an offline repository
}
}
@@ -186,6 +198,9 @@ rat {
htmlOutput = false
failOnError = true
excludes = [
+ // Ignore any offline repositories the user may have created.
+ "**/${offlineRepositoryRoot}/**/*",
+
// Exclude files generated by the Gradle build process
"**/.gradle/**/*",
"**/.gogradle/**/*",
diff --git a/build_rules.gradle b/build_rules.gradle
index 94ea28aef65..65d0249c463 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -29,7 +29,6 @@
//
// For example, see applyJavaNature below.
-
println "Applying build_rules.gradle to $project.name"
/*************************************************************************************************/
@@ -40,6 +39,17 @@ version = "2.3.0-SNAPSHOT"
// Define the default set of repositories for all builds.
repositories {
+ maven { url offlineRepositoryRoot }
+
+ // To run gradle in offline mode, one must first invoke
+ // 'updateOfflineRepository' to create an offline repo
+ // inside the root project directory. See the application
+ // of the offline repo plugin within build_rules.gradle
+ // for further details.
+ if (gradle.startParameter.isOffline()) {
+ return
+ }
+
mavenLocal()
mavenCentral()
jcenter()
@@ -70,6 +80,30 @@ apply plugin: "project-report"
// See https://github.com/mmalohlava/gradle-visteg for further details.
apply plugin: "cz.malohlava.visteg"
+// Apply a plugin which provides the 'updateOfflineRepository' task that
creates an offline
+// repository. This offline repository satisfies all Gradle build dependencies
and Java
+// project dependencies. The offline repository is placed within
$rootDir/offline-repo
+// but can be overridden by specifying the 'offlineRepositoryRoot' Gradle
option.
+// Note that parallel build must be disabled when executing
'updateOfflineRepository'
+// by specifying '-Dorg.gradle.parallel=false', see
+//
https://github.com/mdietrichstein/gradle-offline-dependencies-plugin/issues/3
+apply plugin: "io.pry.gradle.offline_dependencies"
+
+offlineDependencies {
+ repositories {
+ maven { url offlineRepositoryRoot }
+ mavenLocal()
+ mavenCentral()
+ jcenter()
+ maven { url "https://plugins.gradle.org/m2/" }
+ maven { url "http://repo.spring.io/plugins-release" }
+ }
+
+ includeSources = false
+ includeJavadocs = false
+ includeIvyXmls = false
+}
+
/*************************************************************************************************/
diff --git a/gradle.properties b/gradle.properties
index 95465df5832..a89dc72f7cb 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,3 +17,4 @@
################################################################################
org.gradle.parallel=true
org.gradle.configureondemand=true
+offlineRepositoryRoot=offline-repository
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Enable running the build within a sandbox without needing to have network
> access
> --------------------------------------------------------------------------------
>
> Key: BEAM-3443
> URL: https://issues.apache.org/jira/browse/BEAM-3443
> Project: Beam
> Issue Type: Improvement
> Components: build-system
> Reporter: Luke Cwik
> Assignee: Luke Cwik
> Priority: Minor
>
> Being able to build the project without needing network access allows one to
> hack on the project within an offline environment or build and run demos
> without network access.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)