Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
santhh committed Mar 16, 2020
0 parents commit cba36ab
Show file tree
Hide file tree
Showing 10 changed files with 620 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

93 changes: 93 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Compiled class file
*.class
*.csv

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
deid-template.json
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*#
*.iml
*.ipr
*.iws
*.jar
*.sw?
*~
.#*
.*.md.html
.DS_Store
.classpath
.factorypath
.gradle
.idea
.metadata
.project
.recommenders
.settings
.springBeans
/build
/code
MANIFEST.MF
_site/
activemq-data
bin
build
build.log
dependency-reduced-pom.xml
dump.rdb
interpolated*.xml
manifest.yml
overridedb.*
settings.xml
target
transaction-logs
.flattened-pom.xml
secrets.yml
.gradletasknamecache
.sts4-cache# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.apt_generated
130 changes: 130 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
* Copyright 2020 Google LLC
*
* 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.
*/
buildscript {
ext {
dataflowBeamVersion = '2.19.0'

}
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.19"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:1.4.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.24.2"


}

}

}

repositories {
mavenCentral()

}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "net.ltgt.apt"
apply plugin: 'com.google.cloud.tools.jib'
apply plugin: "com.diffplug.gradle.spotless"


//mainClassName = System.getProperty("mainClass")
mainClassName = 'com.google.solutions.df.video.analytics.VideoAnalyticsPipeline'
jib {
from {
image = 'gcr.io/dataflow-templates-base/java8-template-launcher-base:latest'
}
container {
appRoot = '/template/df-video-analytics-template'
entrypoint = 'INHERIT'
environment = [DATAFLOW_JAVA_COMMAND_SPEC:'/template/df-video-analytics-template/resources/java_command_spec.json']

}
}
group 'com.google.solutions'
version '0.1.0'

sourceCompatibility = 1.8
targetCompatibility = 1.8

applicationDefaultJvmArgs = ['-Xms4g', '-Xmx16g']


tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}


dependencies {
compile group: 'org.apache.beam', name: 'beam-sdks-java-core', version: dataflowBeamVersion
compile group: 'org.apache.beam', name: 'beam-runners-google-cloud-dataflow-java', version:dataflowBeamVersion
compile group: 'org.apache.beam', name: 'beam-runners-direct-java', version: dataflowBeamVersion
compile group: 'org.apache.beam', name: 'beam-sdks-java-io-amazon-web-services', version: dataflowBeamVersion
compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.5'
compile "com.google.auto.value:auto-value-annotations:1.6.2"
compile 'com.google.cloud:google-cloud-video-intelligence:1.2.0'
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
testCompile group: 'org.apache.beam', name: 'beam-runners-direct-java', version: dataflowBeamVersion
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.5'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile 'junit:junit:4.12'


}

jar {
manifest {
attributes ('Main-Class': mainClassName)
}



}

compileJava {
// Add additional jvm argument
options.compilerArgs.addAll(['-Xlint:all'])
}

// default tasks when you run ./gradlew
defaultTasks 'clean', 'assemble'
// Google cloud dataflow requires the resource/main directory to exist
task resources {
def resourcesDir = new File('build/resources/main')
resourcesDir.mkdirs()
}

run {
if (project.hasProperty('args')) {
args project.args.split('\\s')
}
}
spotless {
java {
googleJavaFormat()
}
}

run.mustRunAfter 'resources'
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit cba36ab

Please sign in to comment.