Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wisdom-framework/wisdom into bugs…
Browse files Browse the repository at this point in the history
…/564-fix-maven-raml-builder-plugin
  • Loading branch information
Riduidel committed Nov 16, 2016
2 parents b7a36db + c8f563c commit f3b3ac8
Show file tree
Hide file tree
Showing 15 changed files with 1,110 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
package org.wisdom.maven.mojos;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -51,6 +49,8 @@ public class TypeScript {

protected boolean noImplicitAny = false;

protected File project;

public boolean isEnabled() {
return enabled;
}
Expand Down Expand Up @@ -143,50 +143,64 @@ public TypeScript setNoImplicitAny(boolean noImplicitAny) {

public List<String> createTypeScriptCompilerArgumentList(File input, File destination, Collection<File> files) {
List<String> arguments = new ArrayList<>();
if (removeComments) {
arguments.add("--removeComments");
}

if (generateDeclaration) {
arguments.add("--declaration");
}
if (project == null) {

if (mapRoot != null) {
arguments.add("--mapRoot");
arguments.add(mapRoot.getAbsolutePath());
}
if (removeComments) {
arguments.add("--removeComments");
}

if (module != null) {
arguments.add("--module");
arguments.add(module);
}
if (generateDeclaration) {
arguments.add("--declaration");
}

if (generateMap) {
arguments.add("--sourceMap");
}
if (mapRoot != null) {
arguments.add("--mapRoot");
arguments.add(mapRoot.getAbsolutePath());
}

if (noImplicitAny) {
arguments.add("--noImplicitAny");
}
if (module != null) {
arguments.add("--module");
arguments.add(module);
}

if (target != null) {
arguments.add("--target");
arguments.add(target);
}
if (generateMap) {
arguments.add("--sourceMap");
}

if (!otherArguments.isEmpty()) {
arguments.addAll(otherArguments);
}
if (noImplicitAny) {
arguments.add("--noImplicitAny");
}

arguments.add("--outDir");
arguments.add(destination.getAbsolutePath());
if (target != null) {
arguments.add("--target");
arguments.add(target);
}

arguments.add("--rootDir");
arguments.add(input.getAbsolutePath());
if (!otherArguments.isEmpty()) {
arguments.addAll(otherArguments);
}

// Now we need to list all .ts files
files.stream().forEach(f -> arguments.add(f.getAbsolutePath()));
arguments.add("--outDir");
arguments.add(destination.getAbsolutePath());

arguments.add("--rootDir");
arguments.add(input.getAbsolutePath());

// Now we need to list all .ts files
files.stream().forEach(f -> arguments.add(f.getAbsolutePath()));
} else {
arguments.add("--project");
arguments.add(project.getAbsolutePath());
}
return arguments;
}

public File getProject() {
return project;
}

public void setProject(File project) {
this.project = project;
}
}
27 changes: 27 additions & 0 deletions extensions/wisdom-browser-watch/README.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
= browser watch support for Wisdom

== Description

Already dreamt of having your browser content auto-reloaded when the fragment you're working on changes ? This extension allows that

== Installation

This extension is a complementary application. As a consequence, adding it is as simple as adding a new dependency
----
<plugin>
<groupId>org.wisdom-framework</groupId>
<artifactId>wisdom-browser-watch</artifactId>
<version>${project.version}</version>
</plugin>
----



== Usages

When you change files in your Wisdom project, this one triggers an undeploy/redeploy of the application. This reload is listened by this extension which send over websocket a signal to browser. This signal, in turn, reload the page **when** the bundle used to display current page is changed.

Notice that, as the listening code is only added on HTML files, this will hardly work on pure Javascript modules.

== Configuration
There is no configuration required at all.
211 changes: 211 additions & 0 deletions extensions/wisdom-browser-watch/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
Wisdom-Framework
%%
Copyright (C) 2013 - 2014 Wisdom Framework
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

<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.wisdom-framework</groupId>
<artifactId>wisdom-framework</artifactId>
<version>0.10.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>wisdom-browser-watch</artifactId>

<packaging>wisdom</packaging>

<properties>
<java.version>1.8</java.version>
<wisdom.version>0.9.1</wisdom.version>
</properties>

<dependencies>
<dependency>
<groupId>org.wisdom-framework</groupId>
<artifactId>wisdom-api</artifactId>
</dependency>

<!-- Seems like it's required to access the LogService -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo</artifactId>
</dependency>

<!-- used for Javascript injection -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.2</version>
<scope>compile</scope>
</dependency>


<!-- Test dependencies -->
<dependency>
<groupId>org.wisdom-framework</groupId>
<artifactId>wisdom-test</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
<dependency>
<groupId>org.fluentlenium</groupId>
<artifactId>fluentlenium-assertj</artifactId>
</dependency>
<dependency>
<!-- slf4j binding used for tests -->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jcl</artifactId>
<version>1.7.9</version>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<!-- Define all the versions of the dependencies provided by Wisdom -->
<groupId>org.wisdom-framework</groupId>
<artifactId>wisdom-bom</artifactId>
<version>${wisdom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.wisdom-framework</groupId>
<artifactId>wisdom-maven-plugin</artifactId>
<version>${wisdom.version}</version>
<extensions>true</extensions>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source> <!-- It's 2k15 ! -->
<target>${java.version}</target>
<testSource>${java.version}</testSource>
<testTarget>${java.version}</testTarget>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<properties>
<property>
<name>listener</name>
<value>org.wisdom.test.WisdomRunListener</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.wisdom-framework
</groupId>
<artifactId>
wisdom-maven-plugin
</artifactId>
<versionRange>
[0.9.1,)
</versionRange>
<goals>
<goal>compile</goal>
<goal>compile-coffeescript</goal>
<goal>compile-javascript</goal>
<goal>compile-less</goal>
<goal>copy-assets</goal>
<goal>copy-configuration</goal>
<goal>copy-resources</goal>
<goal>copy-templates</goal>
<goal>initialize</goal>
<goal>minify-css</goal>
<goal>optimize-images</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<repositories>
<repository>
<id>oss-snapshot</id>
<name>oss-snapshot</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>oss-snapshot</id>
<name>oss-snapshot</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
</project>
Loading

0 comments on commit f3b3ac8

Please sign in to comment.