Skip to content

Commit

Permalink
First commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-wyluda committed Jul 2, 2013
0 parents commit 8963a49
Show file tree
Hide file tree
Showing 38 changed files with 2,369 additions and 0 deletions.
84 changes: 84 additions & 0 deletions addon/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>gradle-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>gradle</artifactId>
<name>Forge - Gradle Addon</name>
<dependencies>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>gradle-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>gradle-impl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>gradle-impl-projects</artifactId>
<scope>runtime</scope>
</dependency>

<!-- Addons -->
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>environment</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>resources</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>dependencies</artifactId>
<classifier>forge-addon</classifier>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>projects</artifactId>
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>parser-java</artifactId>
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>ui</artifactId>
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>create-forge-addon</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<inherited>false</inherited>
<configuration>
<classifier>forge-addon</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle;

54 changes: 54 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>gradle-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>gradle-api</artifactId>
<name>Forge - Gradle API</name>

<properties>
<version.maven>3.0.5</version.maven>
</properties>

<dependencies>
<dependency>
<groupId>org.jboss.forge.furnace</groupId>
<artifactId>furnace-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>dependencies-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>resources-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>environment-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge.addon</groupId>
<artifactId>projects-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${version.maven}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects;

import org.jboss.forge.addon.gradle.projects.model.GradleModel;
import org.jboss.forge.addon.projects.ProjectFacet;

/**
* Performs Gradle specific operations.
*
* @author Adam Wyłuda
*/
public interface GradleFacet extends ProjectFacet

This comment has been minimized.

Copy link
@gastaldi

gastaldi Jul 2, 2013

Member

Add a

FileResource<?> getGradleResource()

So it's possible to know where this resource is located

{
void executeTask(String task);

void executeTask(String task, String profile);

GradleModel getModel();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public interface GradleDependency
{
String getName();

String getGroup();

GradleDependencyConfiguration getConfiguration();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public enum GradleDependencyConfiguration
{
COMPILE, TEST;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

import java.util.List;

/**
* Contains information about Gradle build script.
*
* @author Adam Wyłuda
*/
public interface GradleModel
{
List<GradleTask> getTasks();

List<GradleDependency> getDependencies();

List<GradleProfile> getProfiles();

List<GradlePlugin> getPlugins();

List<GradleRepository> getRepositories();

void createTask(GradleTaskBuilder builder);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public interface GradlePlugin
{
String getClazz();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* It represents Gradle simulated profile.
*
* @author Adam Wyłuda
*/
public interface GradleProfile
{
String getName();

GradleModel getModel();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public interface GradleRepository
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public interface GradleTask
{
String getName();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.gradle.projects.model;

/**
* @author Adam Wyłuda
*/
public class GradleTaskBuilder
{
private String name = "forgeTask";
private String dependsOn = "";
private String type = "";
private String code = "";

private GradleTaskBuilder()
{
}

public static GradleTaskBuilder create()
{
return new GradleTaskBuilder();
}

public String getName()
{
return name;
}

public GradleTaskBuilder setName(String name)
{
this.name = name;
return this;
}

public String getDependsOn()
{
return dependsOn;
}

public GradleTaskBuilder setDependsOn(String dependsOn)
{
this.dependsOn = dependsOn;
return this;
}

public GradleTaskBuilder setDependsOn(GradleTask task)
{
setDependsOn(task.getName());
return this;
}

public String getType()
{
return type;
}

public GradleTaskBuilder setType(String type)
{
this.type = type;
return this;
}

public String getCode()
{
return code;
}

public GradleTaskBuilder setCode(String code)
{
this.code = code;
return this;
}
}
Loading

0 comments on commit 8963a49

Please sign in to comment.