Merge pull request #40 from guoshimin/haskell-client

Script to generate haskell client
This commit is contained in:
Mehdy Bohlool
2017-12-21 15:45:34 -06:00
committed by GitHub
2 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.kubernetes</groupId>
<artifactId>client-haskell</artifactId>
<version>1.0-SNAPSHOT</version>
<name>client-haskell</name>
<url>http://kubernetes.io</url>
<build>
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger-codegen-version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${generator.spec.path}</inputSpec>
<language>haskell-http-client</language>
<output>${generator.output.path}</output>
<configOptions>
<packageName>${generator.package.name}</packageName>
<packageVersion>${generator.client.version}</packageVersion>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

52
openapi/haskell.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Copyright 2017 The Kubernetes 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.
set -o errexit
set -o nounset
set -o pipefail
ARGC=$#
if [ $# -ne 2 ]; then
echo "Usage:"
echo " haskell.sh OUTPUT_DIR SETTING_FILE_PATH"
echo " Setting file should define KUBERNETES_BRANCH, CLIENT_VERSION, and PACKAGE_NAME"
exit 1
fi
OUTPUT_DIR=$1
SETTING_FILE=$2
mkdir -p "${OUTPUT_DIR}"
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
pushd "${SCRIPT_ROOT}" > /dev/null
SCRIPT_ROOT=`pwd`
popd > /dev/null
pushd "${OUTPUT_DIR}" > /dev/null
OUTPUT_DIR=`pwd`
popd > /dev/null
source "${SCRIPT_ROOT}/client-generator.sh"
source "${SETTING_FILE}"
SWAGGER_CODEGEN_COMMIT=5b76151a874009605f5ac5d4e6dc1aaa389339ed; \
CLIENT_LANGUAGE=haskell-http-client; \
CLEANUP_DIRS=(lib); \
kubeclient::generator::generate_client "${OUTPUT_DIR}"
echo "---Done."