diff options
author | gjoranv <gv@oath.com> | 2017-12-04 14:01:00 +0100 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2017-12-04 14:01:00 +0100 |
commit | e8e619df687620c0b0f25a4c56330096b6ede369 (patch) | |
tree | 2dfd644be4723af42d2a46ba66dfa9169a5dd228 /container-dev-builder | |
parent | d164fbb93e277ef23ab610320a7cf8556e3c036e (diff) |
Remove unused module container-dev-builder.
Diffstat (limited to 'container-dev-builder')
8 files changed, 0 insertions, 320 deletions
diff --git a/container-dev-builder/OWNERS b/container-dev-builder/OWNERS deleted file mode 100644 index 3b2ba1ede81..00000000000 --- a/container-dev-builder/OWNERS +++ /dev/null @@ -1 +0,0 @@ -gjoranv diff --git a/container-dev-builder/README.md b/container-dev-builder/README.md deleted file mode 100644 index 3218833930a..00000000000 --- a/container-dev-builder/README.md +++ /dev/null @@ -1,4 +0,0 @@ -<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -# container-dev-builder - -TODO diff --git a/container-dev-builder/dependency_blacklist b/container-dev-builder/dependency_blacklist deleted file mode 100644 index 7b0d647464d..00000000000 --- a/container-dev-builder/dependency_blacklist +++ /dev/null @@ -1,2 +0,0 @@ -antlr:antlr -junit:junit diff --git a/container-dev-builder/make.sh b/container-dev-builder/make.sh deleted file mode 100755 index c434b13ee7b..00000000000 --- a/container-dev-builder/make.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -export VERSION=$1 -if [ -z "$VERSION" ] -then - echo "usage: $(basename $0) <version> [<builddir>]" - exit 1 -fi -echo VERSION=$VERSION - -export BASEDIR=$2 -if [ "$BASEDIR" ] -then - export POM_FORMAT="$BASEDIR/%s-HEAD/%s/pom.xml" -else - export POM_FORMAT="$(pwd)/../%s/pom.xml" -fi -echo POM_FORMAT=$POM_FORMAT -echo - -echo "-------------------------------------------------------------------------------" -echo "Compiling toolkit." -echo "-------------------------------------------------------------------------------" -cd tools -mvn -q clean install -DskipTests -JAVA_TOOLS="java -cp $(pwd)/target/tools-jar-with-dependencies.jar" -echo -cd .. - -DEPS_NEXT="com.yahoo.vespa:container-disc:jar:$VERSION:compile" -DEPS_PREV="" -BLACKLIST=$(cat dependency_blacklist) - -PASS=0 -rm -rf target -mkdir target -cd target -while [ "$DEPS_NEXT" ] -do - PASS=$((PASS+1)) - mkdir -p "pass$PASS" - cd "pass$PASS" - - DEPS_PREV=$DEPS_NEXT - DEPS_NEXT="" - - echo "-------------------------------------------------------------------------------" - echo "Deriving dependencies, pass $PASS." - echo "-------------------------------------------------------------------------------" - echo DEPENDENCIES=$DEPS_PREV - echo "Building dependency tree.." - $JAVA_TOOLS com.yahoo.container.dev.builder.PomFileGenerator $VERSION $DEPS_PREV > pom.xml - mvn -q dependency:tree -DoutputFile=dependencies - DEPS_NEXT="$($JAVA_TOOLS com.yahoo.container.dev.builder.DependencyResolver . $BLACKLIST)" - - echo "Resolving X-JDisc-Preinstall-Bundle instructions.." - mvn -q dependency:unpack-dependencies \ - -DexcludeTransitive=true \ - -Dmdep.unpack.includes="META-INF/MANIFEST.MF" \ - -Dmdep.useSubDirectoryPerArtifact=true \ - -DoutputDirectory=. - DEPS_NEXT="$DEPS_NEXT $($JAVA_TOOLS com.yahoo.container.dev.builder.PreinstalledBundleResolver . "$POM_FORMAT")" - - DEPS_NEXT=$(echo $DEPS_NEXT | sort | uniq) - [ "$DEPS_NEXT" == "$DEPS_PREV" ] && DEPS_NEXT="" - echo - cd .. -done - -echo "-------------------------------------------------------------------------------" -echo "Testing final pom.xml" -echo "-------------------------------------------------------------------------------" -cp pass$PASS/pom.xml . -mvn clean install -DskipTests || exit 1 -cd .. diff --git a/container-dev-builder/tools/pom.xml b/container-dev-builder/tools/pom.xml deleted file mode 100644 index 3c1132e439d..00000000000 --- a/container-dev-builder/tools/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0"?> -<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -<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>tools</groupId> - <artifactId>tools</artifactId> - <version>1.0</version> - <dependencies> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> - <version>3.1.1</version> - </dependency> - </dependencies> - <build> - <finalName>${project.artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.6.1</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.4</version> - <configuration> - <descriptorRefs> - <descriptorRef>jar-with-dependencies</descriptorRef> - </descriptorRefs> - </configuration> - <executions> - <execution> - <id>make-assembly</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> -</project> diff --git a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/DependencyResolver.java b/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/DependencyResolver.java deleted file mode 100644 index 5ebf5488b02..00000000000 --- a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/DependencyResolver.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.dev.builder; - -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; -import java.util.TreeSet; - -/** - * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a> - */ -public class DependencyResolver { - - private static final Path DEPENDENCIES = Paths.get("dependencies"); - - public static void main(String[] args) throws IOException, XmlPullParserException { - final Set<String> blacklist = new HashSet<>(Arrays.asList(args).subList(1, args.length)); - final Set<String> dependencies = new TreeSet<>(); - Files.walkFileTree(Paths.get(args[0]), new SimpleFileVisitor<Path>() { - - @Override - public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { - if (!attrs.isRegularFile()) { - return FileVisitResult.CONTINUE; - } - if (!file.getFileName().equals(DEPENDENCIES)) { - return FileVisitResult.CONTINUE; - } - for (final String line : Files.readAllLines(file, StandardCharsets.UTF_8)) { - for (final String dependency : line.split(" ")) { - if (dependency == null || dependency.isEmpty()) { - continue; - } - final String[] arr = dependency.split(":"); - if (arr.length != 5 || blacklist.contains(arr[0] + ":" + arr[1])) { - continue; - } - dependencies.add(dependency); - } - } - return FileVisitResult.CONTINUE; - } - }); - for (final String dependency : dependencies) { - System.out.println(dependency); - } - } -} diff --git a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PomFileGenerator.java b/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PomFileGenerator.java deleted file mode 100644 index 7eb884034d6..00000000000 --- a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PomFileGenerator.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.dev.builder; - -import org.apache.maven.model.Dependency; -import org.apache.maven.model.Model; -import org.apache.maven.model.io.xpp3.MavenXpp3Writer; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.TreeSet; - -/** - * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen Hult</a> - */ -public class PomFileGenerator { - - public static void main(String[] args) throws IOException { - Model model = new Model(); - model.setModelVersion("4.0.0"); - model.setGroupId("com.yahoo.vespa"); - model.setArtifactId("container-dev"); - model.setVersion(args[0]); - model.getProperties().setProperty("project.build.sourceEncoding", StandardCharsets.UTF_8.name()); - for (String str : new TreeSet<>(Arrays.asList(args).subList(1, args.length))) { - Dependency dependency = newDependency(str); - if (dependency == null) { - continue; - } - if (dependency.getGroupId().equals(model.getGroupId()) && - dependency.getArtifactId().equals(model.getArtifactId())) { - continue; - } - model.addDependency(dependency); - } - new MavenXpp3Writer().write(System.out, model); - } - - private static Dependency newDependency(String str) { - String[] arr = str.split(":"); - if (arr.length != 5) { - return null; - } - Dependency out = new Dependency(); - out.setGroupId(arr[0]); - out.setArtifactId(arr[1]); - out.setVersion(arr[3]); - return out; - } -} diff --git a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PreinstalledBundleResolver.java b/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PreinstalledBundleResolver.java deleted file mode 100644 index b9187f5a026..00000000000 --- a/container-dev-builder/tools/src/main/java/com/yahoo/container/dev/builder/PreinstalledBundleResolver.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.container.dev.builder; - -import org.apache.maven.model.Model; -import org.apache.maven.model.io.xpp3.MavenXpp3Reader; -import org.apache.maven.project.MavenProject; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.jar.Manifest; - -public class PreinstalledBundleResolver { - - private static final Path MANIFEST_MF = Paths.get("MANIFEST.MF"); - private static final String X_JDISC_PREINSTALL_BUNDLE = "X-JDisc-Preinstall-Bundle"; - private static final String REMOVABLE_SUFFIX = ".jar"; - private static final String REMOVABLE_ASSEMBLY_ID = "-jar-with-dependencies"; - - public static void main(final String[] args) throws Throwable { - Files.walkFileTree(Paths.get(args[0]), new SimpleFileVisitor<Path>() { - - @Override - public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { - if (!attrs.isRegularFile()) { - return FileVisitResult.CONTINUE; - } - if (!file.getFileName().equals(MANIFEST_MF)) { - return FileVisitResult.CONTINUE; - } - final String preinstall = new Manifest(Files.newInputStream(file)) - .getMainAttributes() - .getValue(X_JDISC_PREINSTALL_BUNDLE); - if (preinstall == null) { - return FileVisitResult.CONTINUE; - } - for (String bundle : preinstall.split(",")) { - printDependency(args[1], bundle); - } - return super.visitFile(file, attrs); - } - }); - } - - private static void printDependency(String pomFormat, String bundle) throws IOException { - bundle = bundle.trim(); - if (bundle.isEmpty()) { - return; - } - if (bundle.endsWith(REMOVABLE_SUFFIX)) { - bundle = bundle.substring(0, bundle.length() - REMOVABLE_SUFFIX.length()); - } - if (bundle.endsWith(REMOVABLE_ASSEMBLY_ID)) { - bundle = bundle.substring(0, bundle.length() - REMOVABLE_ASSEMBLY_ID.length()); - } - Path pom = Paths.get(String.format(pomFormat, bundle)); - if (!Files.exists(pom)) { - return; - } - Model model; - try { - model = new MavenXpp3Reader().read(Files.newBufferedReader(pom, StandardCharsets.UTF_8)); - } catch (XmlPullParserException e) { - e.printStackTrace(); - return; - } - model.setPomFile(pom.toFile()); - final MavenProject project = new MavenProject(model); - System.out.println(project.getGroupId() + ":" + - project.getArtifactId() + ":jar:" + - project.getVersion() + ":compile"); - } -} |