[
https://issues.apache.org/jira/browse/FLINK-9222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578466#comment-16578466
]
ASF GitHub Bot commented on FLINK-9222:
---------------------------------------
twalthr commented on a change in pull request #105: [FLINK-9222] add gradle
quickstart script
URL: https://github.com/apache/flink-web/pull/105#discussion_r209652918
##########
File path: q/gradle-quickstart.sh
##########
@@ -0,0 +1,226 @@
+#!/bin/bash
+
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+################################################################################
+
+declare -r TRUE=0
+declare -r FALSE=1
+
+# takes a string and returns true if it seems to represent "yes"
+function isYes() {
+ local x=$1
+ [ $x = "y" -o $x = "Y" -o $x = "yes" ] && echo $TRUE; return
+ echo $FALSE
+}
+
+function mkDir() {
+ local x=$1
+ echo ${x// /-} | tr '[:upper:]' '[:lower:]'
+}
+
+function mkPackage() {
+ local x=$1
+ echo ${x//./\/}
+}
+
+defaultProjectName="quickstart"
+defaultOrganization="org.myorg.quickstart"
+defaultVersion="0.1-SNAPSHOT"
+defaultScalaBinaryVersion="2.11"
+defaultFlinkVersion="1.6-SNAPSHOT"
+
+echo "This script creates a Flink project using Java and Gradle."
+
+while [ $TRUE ]; do
+
+ echo ""
+ read -p "Project name ($defaultProjectName): " projectName
+ projectName=${projectName:-$defaultProjectName}
+ read -p "Organization ($defaultOrganization): " organization
+ organization=${organization:-$defaultOrganization}
+ read -p "Version ($defaultVersion): " version
+ version=${version:-$defaultVersion}
+ read -p "Scala version ($defaultScalaBinaryVersion): " scalaBinaryVersion
+ scalaBinaryVersion=${scalaBinaryVersion:-$defaultScalaBinaryVersion}
+ read -p "Flink version ($defaultFlinkVersion): " flinkVersion
+ flinkVersion=${flinkVersion:-$defaultFlinkVersion}
+
+ echo ""
+ echo "-----------------------------------------------"
+ echo "Project Name: ${projectName}"
+ echo "Organization: ${organization}"
+ echo "Version: ${version}"
+ echo "Scala binary version: ${scalaBinaryVersion}"
+ echo "Flink version: ${flinkVersion}"
+ echo "-----------------------------------------------"
+ read -p "Create Project? (Y/n): " createProject
+ createProject=${createProject:-y}
+
+ [ "$(isYes "${createProject}")" = "$TRUE" ] && break
+
+done
+
+directoryName=$(mkDir "${projectName}")
+
+echo "Creating Flink project under ${directoryName}"
+
+mkdir -p ${directoryName}
+cd ${directoryName}
+
+# Create the README file
+
+cat > README <<EOF
+A Flink application project using Java and Gradle.
+
+To package your job for submission to Flink, use: 'gradle shadowJar'
Review comment:
Can you add the location of the built jar here as well?
----------------------------------------------------------------
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]
> Add a Gradle Quickstart
> -----------------------
>
> Key: FLINK-9222
> URL: https://issues.apache.org/jira/browse/FLINK-9222
> Project: Flink
> Issue Type: Improvement
> Components: Project Website, Quickstarts
> Reporter: Nico Kruber
> Assignee: Nico Kruber
> Priority: Critical
> Labels: pull-request-available
>
> Having a proper project template helps a lot in getting dependencies right.
> For example, setting the core dependencies to "provided", the connector /
> library dependencies to "compile", etc.
> The Maven quickstarts are in good shape by now, but there is none for Gradle
> and Gradle users to get this wrong quite often.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)