notatestuser / neo-contracts-workspace-kotlin

A starting point for writing contracts in kotlin
2 stars 1 forks source link

doesnt compile after git clone #1

Open randomnerd opened 6 years ago

randomnerd commented 6 years ago

hi there! is this still maintained? didnt work for me:

random-mbp:neo-contracts-workspace-kotlin randomnerd$ make
git submodule update --init --recursive --remote .
docker-compose run --rm neo-devpack-java mvn clean install && \
    cp vendor/neo-devpack-java/target/*.jar ./vendor/org.neo.smartcontract.framework.jar
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building NEO DevPack For Java 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ neo-devpack-java ---
[INFO] Deleting /usr/src/project/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ neo-devpack-java ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /usr/src/project/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ neo-devpack-java ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 25 source files to /usr/src/project/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ neo-devpack-java ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /usr/src/project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ neo-devpack-java ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ neo-devpack-java ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ neo-devpack-java ---
[INFO] Building jar: /usr/src/project/target/neo-devpack-java-2.3.0.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ neo-devpack-java ---
[INFO] Installing /usr/src/project/target/neo-devpack-java-2.3.0.jar to /root/.m2/repository/org/neo/smartcontract/framework/neo-devpack-java/2.3.0/neo-devpack-java-2.3.0.jar
[INFO] Installing /usr/src/project/pom.xml to /root/.m2/repository/org/neo/smartcontract/framework/neo-devpack-java/2.3.0/neo-devpack-java-2.3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.055 s
[INFO] Finished at: 2018-03-02T16:58:37Z
[INFO] Final Memory: 16M/137M
[INFO] ------------------------------------------------------------------------
docker-compose run --rm maven mvn clean install
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building smart-contracts 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ smart-contracts ---
[INFO] Deleting /usr/src/project/target
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ smart-contracts ---
[INFO] Source directory: /usr/src/project/vendor/neo-devpack-java/src added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ smart-contracts ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/src/project/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ smart-contracts ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 25 source files to /usr/src/project/target/classes
[INFO] 
[INFO] --- kotlin-maven-plugin:1.1.4:compile (compile) @ smart-contracts ---
[INFO] Kotlin version 1.1.4 (JRE 1.8.0_151-b12)
[INFO] Compiling Kotlin sources from [/usr/src/project/src/main/kotlin, /usr/src/project/vendor/neo-devpack-java/src]
[INFO] Module name is smart-contracts
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (7, 40) Parameter 'args' is never used
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (7, 46) This class shouldn't be used in Kotlin. Use kotlin.Any instead.
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (7, 56) This class shouldn't be used in Kotlin. Use kotlin.Any instead.
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (10, 35) This class shouldn't be used in Kotlin. Use kotlin.Any instead.
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (13, 35) This class shouldn't be used in Kotlin. Use kotlin.Any instead.
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (16, 26) This class shouldn't be used in Kotlin. Use kotlin.Any instead.
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (20, 20) Parameter 'op' is never used
[WARNING] /usr/src/project/src/main/kotlin/Contract.kt: (25, 20) Parameter 'op' is never used
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ smart-contracts ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /usr/src/project/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ smart-contracts ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- kotlin-maven-plugin:1.1.4:test-compile (test-compile) @ smart-contracts ---
[INFO] Kotlin version 1.1.4 (JRE 1.8.0_151-b12)
[INFO] Compiling Kotlin sources from [/usr/src/project/src/test/kotlin]
[INFO] Module name is smart-contracts
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ smart-contracts ---
[INFO] Surefire report directory: /usr/src/project/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running contracts.tests.ContractTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.156 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ smart-contracts ---
[INFO] Building jar: /usr/src/project/target/smart-contracts-1.0.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ smart-contracts ---
[INFO] Installing /usr/src/project/target/smart-contracts-1.0.jar to /root/.m2/repository/org/neo/contracts/smart-contracts/1.0/smart-contracts-1.0.jar
[INFO] Installing /usr/src/project/pom.xml to /root/.m2/repository/org/neo/contracts/smart-contracts/1.0/smart-contracts-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.896 s
[INFO] Finished at: 2018-03-02T16:58:56Z
[INFO] Final Memory: 31M/211M
[INFO] ------------------------------------------------------------------------
docker-compose run --rm --entrypoint "/bin/sh" neoj scripts/build-avms.sh
Building neoj
ERROR: Cannot locate specified Dockerfile: Dockerfile
make: *** [build-avms] Error 1
notatestuser commented 6 years ago

Looks like the submodules weren't pulled correctly. Could you check the content of vendor/neo-compiler and try to pull submodules again?

$ git submodule update --init --recursive --remote .
randomnerd commented 6 years ago

didnt help:

random-mbp:neo-contracts-workspace-kotlin randomnerd$ git submodule update --init --recursive --remote .
random-mbp:neo-contracts-workspace-kotlin randomnerd$ ls vendor/neo-compiler/
LICENSE         neo-compiler.sln    neoa            neoj            neon

and make gives the same error

notatestuser commented 6 years ago

Is there a Dockerfile in vendor/neo-compiler/neoj?

randomnerd commented 6 years ago

nope

randomnerd commented 6 years ago
ls vendor/neo-compiler/neoj/
AntsModule.cs   ILogger.cs  JVM     MyJson.cs   Program.cs  neoj.csproj
notatestuser commented 6 years ago

Use the neo-compiler from here: https://github.com/notatestuser/neo-compiler/tree/feature/macOS/neoj

randomnerd commented 6 years ago

can i just take dockerfile from there or should i clone the whole repo?

randomnerd commented 6 years ago

i did replace the whole compiler folder, but it looks like makefile does restore it anyway

random-mbp:neo-contracts-workspace-kotlin randomnerd$ make
git submodule update --init --recursive --remote .
Submodule path 'vendor/neo-compiler': checked out '424311669c3b3e55c8f159aedb2bb5d9365ba876'

and it exits with that same error again, i guess the master branch is broken :(

notatestuser commented 6 years ago

Not maintained anyway but works well for me. Pull requests welcome.