Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

gradle.bat not in PATH reported, even though it is... #5

Open
Lewiscowles1986 opened this issue Feb 3, 2016 · 2 comments
Open

gradle.bat not in PATH reported, even though it is... #5

Lewiscowles1986 opened this issue Feb 3, 2016 · 2 comments

Comments

@Lewiscowles1986
Copy link

See sample output from cmd

image

The system is windows 8.1 all the latest updates, Atom and Windows have been rebooted since Gradle was installed, and Gradle was installed as per docs on Gradle website.

image

I then re-tried using a specified path to my Gradle...

@Lewiscowles1986
Copy link
Author

modified gradle-runner.coffee and reloaded Atom

{BufferedProcess} = require 'atom'
path = require 'path'
FileFinderUtil = require './file-finder-util'
util = require 'util'

class GradleRunner
  constructor: () ->
    @fileFinderUtil = new FileFinderUtil()
    @gradleHome=atom.config.get('gradle-manager.gradle_home')

  getGradleTasks: (onOutput, onError, onExit, args) ->
    @runGradle 'tasks',onOutput, onError, onExit, args


  runGradle: (task, onOutput, stderr, exit, extraArgs) ->
    cwd=atom.project.getPaths()[0]

    @process?.kill()
    @process = null
    win= process.platform.indexOf 'win'
    ##get run command
    command = 'gradle'

    args=[]
    ##add options and args
    for arg in task.split ' '
      args.push(arg)

    if extraArgs
      for arg in extraArgs.split ' '
        args.push arg
    onOutput util.format('Path: "%s"', cwd),'text-info'
    if extraArgs
      onOutput util.format('Execute: "%s %s %s"', command,task,extraArgs),'text-info'
    else
      onOutput util.format('Execute: "%s %s"', command,task),'text-info'
    @process = new BufferedProcess
      command: command
      args: args
      options:
        env: process.env,
        cwd:cwd
      stdout: onOutput
      stderr: stderr
      exit: exit

  destroy: ->
    @process?.kill()
    @process = null

module.exports = GradleRunner

@Lewiscowles1986
Copy link
Author

basically the edit fixes for me in windows, it seems an assumption of the plugin is that gradle can be added to path, or run directly. Once Gradle is successfully added to the path, it should not need all the complex loading; the command Gradle, should work regardless of operating on Windows or Linux, or Mac. I'm happy to submit a PR, however my CoffeeScript is rudimentary at best

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant