пятница, 10 ноября 2017 г.

vscode + Gradle PRJ (min)

build.gradle




apply plugin: 'java'

sourceSets {
   main {
      java {
         srcDir 'src'
      }
   }
    
   test {
      java {
         srcDir 'test'
      }
   }
}

VScode Maven PRJ

  1. First, download Maven and follow the installation instructions and verify your installation
        mvn --version
     
  2. Invoke the maven quickstart archetype to generate your new project.
        mvn archetype:generate
        -DgroupId=com.mycompany.app
        -DartifactId=my-app
        -DarchetypeArtifactId=maven-archetype-quickstart
        -DinteractiveMode=false
     
  3. Start VS Code with the new project
        code ./my-app

четверг, 9 ноября 2017 г.

VSCode Java (debug build run)

task.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "javac",
            "args": [
                "-g",
                "-d",
                "bin",
                "${file}"
            ]
        },
        {
            "label": "run",
            "command": "java",
            "args": [
                "-classpath",
                "./bin",
                "Main"
            ]
        }
    ]
}

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Debug (Launch)",
            "request": "launch",
            "mainClass": "Main",
            "args": "",
            "classPaths": [
                "./bin"
            ]
        },
        {
            "type": "java",
            "name": "Debug (Attach)",
            "request": "attach",
            "hostName": "localhost",
            "port": 0
        }
    ]
}