aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/java/generate_pom.cc
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2017-01-07 07:14:56 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-07 07:25:59 -0800
commit18ba73bea5864b004482efdd7de6458673eb3e1d (patch)
tree7026a016a9d4ac16a0c09b2c14ac14584c80f9f1 /tensorflow/java/generate_pom.cc
parent8047c97a98b1b569a5b37aaaadf410fa4ff076fb (diff)
Java: Generate pom.xml with the appropriate version number.
This commit removes pom.xml and replaces it with a trivial tool to generate it, filling in the appropriate version of the TensorFlow runtime. Change: 143861686
Diffstat (limited to 'tensorflow/java/generate_pom.cc')
-rw-r--r--tensorflow/java/generate_pom.cc60
1 files changed, 60 insertions, 0 deletions
diff --git a/tensorflow/java/generate_pom.cc b/tensorflow/java/generate_pom.cc
new file mode 100644
index 0000000000..85f1c56d5b
--- /dev/null
+++ b/tensorflow/java/generate_pom.cc
@@ -0,0 +1,60 @@
+/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+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.
+==============================================================================*/
+
+#include <iostream>
+#include <string>
+
+#include "tensorflow/c/c_api.h"
+
+int main(int argc, char** argv) {
+ std::string tmpl(R"EOF(
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.tensorflow</groupId>
+ <artifactId>libtensorflow</artifactId>
+ <version>{{TENSORFLOW_VERSION}}</version>
+ <packaging>jar</packaging>
+
+ <name>tensorflow</name>
+ <url>https://www.tensorflow.org</url>
+ <inceptionYear>2015</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>The Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <scm>
+ <url>https://github.com/tensorflow/tensorflow.git</url>
+ <connection>git@github.com:tensorflow/tensorflow.git</connection>
+ <developerConnection>scm:git:https://github.com/tensorflow/tensorflow.git</developerConnection>
+ </scm>
+</project>
+ )EOF");
+
+ const std::string var("{{TENSORFLOW_VERSION}}");
+ const std::string val(TF_Version());
+ for (size_t pos = tmpl.find(var); pos != std::string::npos;
+ pos = tmpl.find(var)) {
+ tmpl.replace(pos, var.size(), val);
+ }
+ std::cout << tmpl;
+ return 0;
+}