Skip to content

Commit

Permalink
Extracted manifest values to manifest.properties file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bashor committed Oct 4, 2013
1 parent dd553ef commit 4f957ea
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 43 deletions.
1 change: 1 addition & 0 deletions .idea/artifacts/KotlinPlugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Kotlin.iml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
<excludeFolder url="$MODULE_DIR$/libraries/out" />
<excludeFolder url="file://$MODULE_DIR$/android.tests.dependencies" />
<excludeFolder url="file://$MODULE_DIR$/dependencies" />
Expand Down
78 changes: 40 additions & 38 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<project name="Kotlin" default="dist">

<property file="resources/manifest.properties" />

<!-- Set to false to disable proguard run on kotlin-compiler.jar. Speeds up the build -->
<property name="shrink" value="true"/>
<!-- Set to false to disable compiler's @NotNull assertions. Speeds up the build -->
Expand Down Expand Up @@ -146,10 +148,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Sources"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.sources}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand All @@ -163,16 +165,16 @@
sourcepathref="compilerSources.path"
classpathref="classpath"
linksource="yes"
windowtitle="Kotlin Compiler"/>
windowtitle="${manifest.impl.title.kotlin.compiler}"/>
<jar jarfile="${output}/kotlin-compiler-javadoc.jar">
<fileset dir="${output}/kotlin-compiler-javadoc"/>
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Javadoc"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.javadoc}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand All @@ -181,10 +183,10 @@
<else>
<jar jarfile="${output}/kotlin-compiler-javadoc.jar">
<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Javadoc"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.javadoc}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand All @@ -204,10 +206,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin JavaScript StdLib"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.javascript.stdlib}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand Down Expand Up @@ -242,10 +244,10 @@
<fileset dir="${output}/classes/preloader"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Preloader"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.preloader}"/>
<attribute name="Implementation-Version" value="${build.number}"/>

<attribute name="Main-Class" value="org.jetbrains.jet.preloading.Preloader"/>
Expand Down Expand Up @@ -273,10 +275,10 @@
<zipgroupfileset dir="${basedir}/dependencies" includes="cli-parser-1.1.1.jar"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler}"/>
<attribute name="Implementation-Version" value="${build.number}"/>

<attribute name="Main-Class" value="org.jetbrains.jet.cli.jvm.K2JVMCompiler"/>
Expand Down Expand Up @@ -430,10 +432,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Ant Tasks"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.ant.task}"/>
<attribute name="Implementation-Version" value="${build.number}"/>

<attribute name="Class-Path" value="kotlin-compiler.jar"/>
Expand All @@ -444,13 +446,13 @@
<target name="jdkAnnotations">
<pack_annotations jarfile="kotlin-jdk-annotations.jar"
annotationsdir="${basedir}/jdk-annotations"
title="Kotlin Compiler JDK Annotations"/>
title="${manifest.impl.title.kotlin.compiler.annotations.jdk}"/>
</target>

<target name="androidSdkAnnotations">
<pack_annotations jarfile="kotlin-android-sdk-annotations.jar"
annotationsdir="${basedir}/android-sdk-annotations"
title="Kotlin Compiler Android SDK Annotations"/>
title="${manifest.impl.title.kotlin.compiler.annotations.android.sdk}"/>
</target>

<macrodef name="pack_annotations">
Expand All @@ -464,9 +466,9 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="@{title}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
Expand All @@ -486,10 +488,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Extended Annotations"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.compiler.annotations.extended}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand Down Expand Up @@ -522,10 +524,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Runtime + StdLib"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.jvm.runtime.and.stdlib}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand All @@ -538,10 +540,10 @@
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Kotlin Compiler Runtime + StdLib Sources"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.kotlin.runtime.and.stdlib.sources}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
Expand All @@ -561,10 +563,10 @@
<fileset dir="${output}/classes/j2k" includes="org/jetbrains/jet/j2k/**"/>

<manifest>
<attribute name="Built-By" value="JetBrains"/>
<attribute name="Built-By" value="${manifest.impl.vendor}"/>

<attribute name="Implementation-Vendor" value="JetBrains"/>
<attribute name="Implementation-Title" value="Java to Kotlin Converter"/>
<attribute name="Implementation-Vendor" value="${manifest.impl.vendor}"/>
<attribute name="Implementation-Title" value="${manifest.impl.title.java2kotlin.converter}"/>
<attribute name="Implementation-Version" value="${build.number}"/>

<attribute name="Main-Class" value="org.jetbrains.jet.j2k.JavaToKotlinTranslator"/>
Expand Down
36 changes: 31 additions & 5 deletions compiler/util/src/org/jetbrains/jet/utils/LibraryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,47 @@

package org.jetbrains.jet.utils;

import com.intellij.openapi.diagnostic.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;

public class LibraryUtils {
public static final String VENDOR_JETBRAINS = "JetBrains";
private static final Logger LOG = Logger.getInstance(LibraryUtils.class);

public static final String TITLE_KOTLIN_RUNTIME_AND_STDLIB = "Kotlin Compiler Runtime + StdLib";
public static final String TITLE_KOTLIN_RUNTIME_AND_STDLIB_SOURCES = "Kotlin Compiler Runtime + StdLib Sources";
public static final String TITLE_KOTLIN_JAVASCRIPT_STDLIB = "Kotlin JavaScript StdLib";
public static final String TITLE_KOTLIN_JVM_RUNTIME_AND_STDLIB;
public static final String TITLE_KOTLIN_JAVASCRIPT_STDLIB;

static {
String jsStdLib = "";
String jvmStdLib = "";

InputStream manifestProperties = LibraryUtils.class.getResourceAsStream("/manifest.properties");
if (manifestProperties != null) {
try {
Properties properties = new Properties();
properties.load(manifestProperties);
jvmStdLib = properties.getProperty("manifest.impl.title.kotlin.jvm.runtime.and.stdlib");
jsStdLib = properties.getProperty("manifest.impl.title.kotlin.javascript.stdlib");
}
catch (IOException e) {
LOG.error(e);
}
}
else {
LOG.error("Resource 'manifest.properties' not found.");
}

TITLE_KOTLIN_JVM_RUNTIME_AND_STDLIB = jvmStdLib;
TITLE_KOTLIN_JAVASCRIPT_STDLIB = jsStdLib;
}

private LibraryUtils() {}

Expand Down Expand Up @@ -71,6 +97,6 @@ public static boolean isJsRuntimeLibrary(@NotNull File library) {
}

public static boolean isJvmRuntimeLibrary(@NotNull File library) {
return checkImplTitle(library, TITLE_KOTLIN_RUNTIME_AND_STDLIB);
return checkImplTitle(library, TITLE_KOTLIN_JVM_RUNTIME_AND_STDLIB);
}
}
1 change: 1 addition & 0 deletions compiler/util/util.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="intellij-core" level="project" />
<orderEntry type="module" module-name="util.runtime" exported="" />
<orderEntry type="module" module-name="Kotlin" exported="" />
</component>
</module>

19 changes: 19 additions & 0 deletions resources/manifest.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
manifest.impl.vendor=JetBrains

manifest.impl.title.kotlin.compiler=Kotlin Compiler
manifest.impl.title.kotlin.compiler.javadoc=Kotlin Compiler Javadoc
manifest.impl.title.kotlin.compiler.sources=Kotlin Compiler Sources

manifest.impl.title.kotlin.compiler.ant.task=Kotlin Compiler Ant Tasks

manifest.impl.title.kotlin.compiler.annotations.jdk=Kotlin Compiler JDK Annotations
manifest.impl.title.kotlin.compiler.annotations.android.sdk=Kotlin Compiler Android SDK Annotations
manifest.impl.title.kotlin.compiler.annotations.extended=Kotlin Extended Annotations

manifest.impl.title.kotlin.jvm.runtime.and.stdlib=Kotlin Compiler Runtime + StdLib
manifest.impl.title.kotlin.runtime.and.stdlib.sources=Kotlin Compiler Runtime + StdLib Sources
manifest.impl.title.kotlin.javascript.stdlib=Kotlin JavaScript StdLib

manifest.impl.title.kotlin.preloader=Kotlin Preloader

manifest.impl.title.java2kotlin.converter=Java to Kotlin Converter

0 comments on commit 4f957ea

Please sign in to comment.