Git Product home page Git Product logo

kompile-testing's People

Contributors

hotchemi avatar mannodermaus avatar technoir42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kompile-testing's Issues

IOException when compiling file

Tried running:

@Test
    fun firstTest() {

        //val inFiles = dirToObjectFiles("com.github.alexdochioiu.test1")

        kotlinc()
            .withProcessors(TimeTurnerProcessor())
            .addKotlin(
                "input.kt", """
        package com.github.alexdochioiu.example

        import android.arch.lifecycle.Lifecycle
        import com.github.alexdochioiu.timeturner.GlobalSurvivor
        import com.github.alexdochioiu.timeturner.Survivor
        import com.github.alexdochioiu.timeturner.SurvivorBinding
        import java.util.*

        /**
         * Created by Alexandru Iustin Dochioiu on 30-Jan-19
         */
        @Survivor
        class TestPresenter(lifecycle: Lifecycle) {

            @GlobalSurvivor
            var survivingElements: MutableList<String> = ArrayList()

            @GlobalSurvivor
            var myInt: Int = 2

            @GlobalSurvivor
            var myBool: Boolean = true

            @GlobalSurvivor
            var myStr = "Test"

            init {
            }
        }
        """.trimIndent()
            )
            .compile()
            .succeeded()

    }
java.io.IOException: Directory 'C:\Users\JeeFo\AppData\Local\Temp\tmp9008736054030136230.tmp\unzippedAar\C:\Users\JeeFo\.gradle\caches\modules-2\files-2.1\com.android.support\appcompat-v7\28.0.0\132586ec59604a86703796851a063a0ac61f697b' could not be created

	at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:361)
	at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:324)
	at org.apache.commons.io.FileUtils.copyToFile(FileUtils.java:1529)
	at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1506)
	at kompile.testing.Compiler.extractJarFromAar(Compiler.kt:143)
	at kompile.testing.Compiler.access$extractJarFromAar(Compiler.kt:22)
	at kompile.testing.Compiler$classpathFiles$2.invoke(Compiler.kt:130)
	at kompile.testing.Compiler$classpathFiles$2.invoke(Compiler.kt:22)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at kompile.testing.Compiler.getClasspathFiles(Compiler.kt)
	at kompile.testing.Compiler.fullClasspath(Compiler.kt:95)
	at kompile.testing.Compiler.compile(Compiler.kt:58)
	at com.github.alexdochioiu.timeturnerprocessor.TimeTurnerProcessorTest.firstTest(TimeTurnerProcessorTest.kt:70)

P.S. I am running Android Studio 3.3.1 on Windows 10

Error regarding tools.jar during test run

I have this test

class SampleTest {
  @Test
  fun testTriggersErrorWhenAppliedToClass() {
    kotlinc()
      .withProcessors(ModelGeneratorProcessor())
      .addKotlin("TestModel.kt", """
        fun main() {
        
        }
      """.trimIndent())
      .compile()
      .failed()
      .withErrorContaining("blah")
  }
}

It fails with

org.junit.ComparisonFailure: null 
Expected :blah
Actual   :error: [kapt] 'com.sun.tools.javac.util.Context' class can't be found ('tools.jar' is absent in the plugin classpath). Kapt won't work.

I am using kotlin 1.3.21, The build.gradle contains:

  testImplementation("org.permissionsdispatcher:kompile-testing:0.1.2")
  testImplementation(files(Jvm.current().toolsJar)) // tried to add this, didn't help

Any hints on what do I do wrong?

Apache license violation and original copyright omission

The file https://github.com/permissions-dispatcher/kompile-testing/blob/master/src/main/java/kompile/testing/Compiler.kt is derived from https://github.com/square/moshi/blob/master/kotlin/codegen/src/test/java/com/squareup/moshi/kotlin/codegen/KotlinCompilerCall.kt but does not retain the copyright designation and license information in the derived work. In order to use this code, you must comply with item 4 of the Apache license (the license of the original work).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.