Skip to content

Qilquiri (from the Aymara writer ) is a helper that writes pieces of common used code in Java for Vim and from command line.

Notifications You must be signed in to change notification settings

percyperezdante/qilquiri

Repository files navigation

qilquiri

Qilquiri (from the Aymara writer ) is a helper that writes pieces of common used code in Java for Vim and from command line.

Qilquiri contains two parts:

  • Part A. The first one writes a basic code in Java, generate all minimum necessary directories, and compiles it using gradle.
  • Part B. The second one are hotkeys for Vim that write common statements, methods or some other signatures while you are editing your code with Vim.

PART A:

Generating Java environment and Spock testing for TDD.

Generate a basic code :

percy@xps:practice$ qilquiri Test
 --> creating template, project directory = Test, main class = test
 --> Generating build.gradle file
 --> Copying test code
 --> Copying Example Spock Test
 --> Copying Spock reporst from Gradle
------------------------------------------
       COMPILING EXAMPLE JAVA
------------------------------------------
 --> BUILD SUCCESSFUL in 5s
------------------------------------------
       RUNNING JAR FILE
------------------------------------------
 --->  clean, build,BUILD SUCCESSFUL in 5s
 --->  running build/libs/Test-0.1.1.jar
 ---> Running application: Everything looks fine unitl now :)
      Add your Java code in   --->  src/main/java/
      Add your Spock tests in --->  src/test/groovy/
------------------------------------------
       SPOCK TESTS
------------------------------------------
 -->:clean :compileJava :compileGroovy NO-SOURCE :processResources NO-SOURCE :classes :compileTestJava NO-SOURCE :compileTestGroovy :processTestResources NO-SOURCE :testClasses :test BUILD SUCCESSFUL in 3s 4 actionable tasks: 4 executed
------------------------------------------
       DISPLAYING REPORT SPOCK TESTS
------------------------------------------
Test Summary

1     0        0       0.026s   100%

tests failures ignored duration successful

  • Packages
  • Classes

Packages

    Package     Tests Failures Ignored Duration Success rate
default-package 1     0        0       0.026s   100%

Classes

   Class    Tests Failures Ignored Duration Success rate
ExampleTest 1     0        0       0.026s   100%

Wrap lines [ ]
Generated by Gradle 4.0 at 26-Nov-2017 19:59:45

 --> Finished

Compiling Java code

percy@xps:Test$ gradle clean build
BUILD SUCCESSFUL in 0s
5 actionable tasks: 5 up-to-date

Executing

percy@xps:Test$ java -jar build/libs/Test-0.1.1.jar
Everything looks fine unitl now :)

Running Spock Testing Framework

percy@xps:Test$ gradle clean test

BUILD SUCCESSFUL in 3s
4 actionable tasks: 4 executed

Displaying report of Spock Tests

percy@xps:Test$ gradle report

> Task :report
Test Summary

1     0        0       0.021s   100%

tests failures ignored duration successful

  • Packages
  • Classes

Packages

    Package     Tests Failures Ignored Duration Success rate
default-package 1     0        0       0.021s   100%

Classes

   Class    Tests Failures Ignored Duration Success rate
ExampleTest 1     0        0       0.021s   100%

Wrap lines [ ]
Generated by Gradle 4.0 at 26-Nov-2017 20:03:07



BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

Internal structure of Test

This will generate the following directory structure

percy@xps:practice$ tree Test/
Test/
├── build
│   ├── classes
│   │   ├── groovy
│   │   │   └── test
│   │   │       └── ExampleTest.class
│   │   └── java
│   │       └── main
│   │           └── Test.class
│   ├── reports
│   │   └── tests
│   │       └── test
│   │           ├── classes
│   │           │   └── ExampleTest.html
│   │           ├── css
│   │           │   ├── base-style.css
│   │           │   └── style.css
│   │           ├── index.html
│   │           ├── js
│   │           │   └── report.js
│   │           └── packages
│   │               └── default-package.html
│   ├── spock-reports
│   │   ├── aggregated_report.json
│   │   ├── ExampleTest.html
│   │   └── index.html
│   ├── test-results
│   │   └── test
│   │       ├── binary
│   │       │   ├── output.bin
│   │       │   ├── output.bin.idx
│   │       │   └── results.bin
│   │       └── TEST-ExampleTest.xml
│   └── tmp
│       ├── compileJava
│       ├── compileTestGroovy
│       │   └── groovy-java-stubs
│       └── test
│           └── jar_extract_4583361065262605450_tmp
├── build.gradle
├── DisplayTestReport.spock
└── src
    ├── main
    │   └── java
    │       └── test
    │           └── Test.java
    └── test
        ├── groovy
        │   └── ExampleTest.groovy
        └── java

29 directories, 20 files

PART B:

Vim Scripts

All you need to do is copy the vim scripts of Qilquiri to your .vimrc.

List of available hotkeys in Vim Insert Mode.

  • Ctrl+D+D Insert "System.out.println("");"
  • Ctrl+T+T Insert "public ( ){}"

About

Qilquiri (from the Aymara writer ) is a helper that writes pieces of common used code in Java for Vim and from command line.

Resources

Stars

Watchers

Forks

Packages

No packages published