changeset 1331:eead74fabfb4

7901738: Update Kotlin benchmark archetype Contributed-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
author shade
date Thu, 21 Jul 2016 17:02:51 +0300
parents e96cad1fc480
children fa510264b3f6
files jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/pom.xml jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/src/main/kotlin/MyBenchmark.kt jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/src/main/kotlin/MyBenchmark.ktm jmh-archetypes/jmh-kotlin-benchmark-archetype/src/test/resources/projects/test/archetype.properties jmh-archetypes/jmh-kotlin-benchmark-archetype/src/test/resources/projects/test/goal.txt
diffstat 6 files changed, 62 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml	Wed Jul 20 23:30:00 2016 +0300
+++ b/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml	Thu Jul 21 17:02:51 2016 +0300
@@ -30,7 +30,7 @@
     <fileSet filtered="true" packaged="true" encoding="UTF-8">
       <directory>src/main/kotlin</directory>
       <includes>
-        <include>**/*.ktm</include>
+        <include>**/*.kt</include>
       </includes>
     </fileSet>
  </fileSets>
--- a/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/pom.xml	Wed Jul 20 23:30:00 2016 +0300
+++ b/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/pom.xml	Thu Jul 21 17:02:51 2016 +0300
@@ -50,10 +50,11 @@
             <artifactId>jmh-core</artifactId>
             <version>\${jmh.version}</version>
         </dependency>
-        <!--
-          Put the dependency on Kotlin stdlib here:
-            org.jetbrains.kotlin:kotlin-stdlib:0.6.2517 is one of the choices
-         -->
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-stdlib</artifactId>
+            <version>\${kotlin.version}</version>
+        </dependency>
     </dependencies>
 
     <prerequisites>
@@ -65,6 +66,12 @@
         <jmh.version>${project.version}</jmh.version>
         <jmh.generator>default</jmh.generator>  <!-- or "asm", or "reflection" -->
         <javac.target>1.6</javac.target>
+        <!--
+           Put an approriate Kotlin compiler and stdlib version here.
+           Available versions are listed here:
+                http://kotlinlang.org/docs/reference/using-maven.html#plugin-and-versions
+         -->
+        <kotlin.version>1.0.2</kotlin.version>
         <uberjar.name>benchmarks</uberjar.name>
     </properties>
 
@@ -80,7 +87,7 @@
                 <!--
                    Put an approriate Kotlin compiler version here.
                  -->
-                <version>PUT_THE_VERSION_HERE</version>
+                <version>\${kotlin.version}</version>
 
                 <executions>
                     <execution>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/src/main/kotlin/MyBenchmark.kt	Thu Jul 21 17:02:51 2016 +0300
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, Oracle America, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ *  * Neither the name of Oracle nor the names of its contributors may be used
+ *    to endorse or promote products derived from this software without
+ *    specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package ${groupId}
+
+import org.openjdk.jmh.annotations.Benchmark
+
+open class MyBenchmark {
+
+    @Benchmark
+    fun testMethod() {
+        // This is a demo/sample template for building your JMH benchmarks. Edit as needed.
+        // Put your benchmark code here.
+    }
+
+}
--- a/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/main/resources/archetype-resources/src/main/kotlin/MyBenchmark.ktm	Wed Jul 20 23:30:00 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle America, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *  * Redistributions of source code must retain the above copyright notice,
- *    this list of conditions and the following disclaimer.
- *
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- *  * Neither the name of Oracle nor the names of its contributors may be used
- *    to endorse or promote products derived from this software without
- *    specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package ${groupId}
-
-import org.openjdk.jmh.annotations.Benchmark
-
-open class MyBenchmark {
-
-    [Benchmark]
-    fun testMethod() {
-        // This is a demo/sample template for building your JMH benchmarks. Edit as needed.
-        // Put your benchmark code here.
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/test/resources/projects/test/archetype.properties	Thu Jul 21 17:02:51 2016 +0300
@@ -0,0 +1,4 @@
+groupId=org.openjdk.jmh
+artifactId=jmh-kotlin-benchmark-archetype-test
+version=1.0-SNAPSHOT
+package=org.openjdk.jmh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-archetypes/jmh-kotlin-benchmark-archetype/src/test/resources/projects/test/goal.txt	Thu Jul 21 17:02:51 2016 +0300
@@ -0,0 +1,1 @@
+verify
\ No newline at end of file