package com.github.blindpirate.gogradle.core.task;

import com.github.blindpirate.gogradle.GolangPluginSetting;
import com.github.blindpirate.gogradle.core.GolangPackageModule;
import com.github.blindpirate.gogradle.core.cache.CacheManager;
import com.github.blindpirate.gogradle.core.pack.LocalFileSystemModule;
import com.github.blindpirate.gogradle.crossplatform.GoBinaryManager;
import com.github.blindpirate.gogradle.crossplatform.GopathManager;
import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.TaskAction;

import javax.inject.Inject;
import java.io.File;

/**
 * This task perform preparation such as Go executable and GOPATH.
 *
 */
public class PrepareTask extends DefaultTask {

    @Inject
    private GoBinaryManager binaryManager;

    @Inject
    private CacheManager cacheManager;

    @Inject
    private GopathManager gopathManager;

    @Inject
    private GolangPluginSetting setting;

    @TaskAction
    public void task() {
        //make sure the go binary is properly installed
        binaryManager.binaryPath();
        determineDependencies();
    }

    private void determineDependencies() {
        File rootDir = getProject().getProjectDir();
        GolangPackageModule projectModule =
                LocalFileSystemModule.fromFileSystem(
                        setting.getPackageName(),
                        rootDir);
        projectModule.getDependencies();
    }


}

@@ -380,76 +380,8 @@
 er;%0A
-import com.github.blindpirate.gogradle.crossplatform.GopathManager;%0A
 impo
@@ -411,16 +411,16 @@
 ltTask;%0A
+
 import o
@@ -577,11 +577,8 @@
 TH.%0A
- *%0A
  */%0A
@@ -685,32 +685,32 @@
 r;%0A%0A    @Inject%0A
+
     private Cach
@@ -737,62 +737,8 @@
 r;%0A%0A
-    @Inject%0A    private GopathManager gopathManager;%0A%0A
     

fix style and remove unused GopathManager