Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maven] Fixing invalid source folder definitions.
close #504 Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
af48213
commit 600ef4f
Showing
16 changed files
with
607 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
|
||
my @BASE_MODULES = ("io.sarl.lang", "io.sarl.lang.core", "org.eclipse.osgi", "org.eclipse.xtend.core"); | ||
|
||
my %MODULE_MAP = ( | ||
"io.sarl.lang" => "io.sarl.lang:io.sarl.lang", | ||
"io.sarl.lang.core" => "io.sarl.lang:io.sarl.lang.core", | ||
"org.eclipse.osgi" => "org.eclipse:osgi", | ||
"org.eclipse.xtend.core" => "org.eclipse.xtend:org.eclipse.xtend.core", | ||
); | ||
|
||
use File::Basename; | ||
use File::Spec; | ||
|
||
my $SCRIPT_DIR = File::Spec->rel2abs(dirname($0)); | ||
my $IN_FILENAME = File::Spec->catfile("$SCRIPT_DIR", "src-templates", "pom.template"); | ||
my $OUT_FILENAME = File::Spec->catfile("$SCRIPT_DIR", "pom.xml"); | ||
|
||
local *INFILE; | ||
|
||
open(*INFILE, "< $IN_FILENAME") or die("$IN_FILENAME: $!\n"); | ||
my $content = ''; | ||
while (my $line = <INFILE>) { | ||
$content .= "$line"; | ||
} | ||
close(*INFILE); | ||
|
||
my $dependencyList = ''; | ||
my $mavenDependencies = ''; | ||
|
||
my @deps = (@BASE_MODULES); | ||
|
||
while (@deps) { | ||
my $dep = shift @deps; | ||
if (!exists $MODULE_MAP{$dep} || !$MODULE_MAP{$dep}) { | ||
die("Undefined mapping from Eclipse plugin '$dep' to equivalent Maven artifact."); | ||
} | ||
if ($dependencyList) { | ||
$dependencyList .= ", "; | ||
} | ||
my $groupId; | ||
my $artifactId; | ||
if ($MODULE_MAP{$dep} =~ /^([^:]+):([^:]+)$/) { | ||
$groupId = "$1"; | ||
$artifactId = "$2"; | ||
} else { | ||
die("Invalid format for '$MODULE_MAP{$dep}'."); | ||
} | ||
$dependencyList .= $MODULE_MAP{$dep}; | ||
$mavenDependencies .= "\t\t<dependency>\n"; | ||
$mavenDependencies .= "\t\t\t<groupId>$groupId</groupId>\n"; | ||
$mavenDependencies .= "\t\t\t<artifactId>$artifactId</artifactId>\n"; | ||
if ($dep =~ /^io\.sarl/) { | ||
$mavenDependencies .= "\t\t\t<exclusions>\n"; | ||
$mavenDependencies .= "\t\t\t\t<exclusion>\n"; | ||
$mavenDependencies .= "\t\t\t\t\t<groupId>*</groupId>\n"; | ||
$mavenDependencies .= "\t\t\t\t\t<artifactId>*</artifactId>\n"; | ||
$mavenDependencies .= "\t\t\t\t</exclusion>\n"; | ||
$mavenDependencies .= "\t\t\t</exclusions>\n"; | ||
} | ||
$mavenDependencies .= "\t\t</dependency>\n"; | ||
} | ||
|
||
$content =~ s/%\%DEPENDENCY_LIST%%/$dependencyList/sg; | ||
$content =~ s/%\%MAVEN_DEPENDENCIES%%/\n$mavenDependencies/sg; | ||
|
||
local *OUTFILE; | ||
open(*OUTFILE, "> $OUT_FILENAME") or die("$OUT_FILENAME: $!\n"); | ||
print OUTFILE "<!-- *******************************************************\n"; | ||
print OUTFILE " * This file is automatically generated. Do not change it. *\n"; | ||
print OUTFILE " ******************************************************* -->\n\n"; | ||
print OUTFILE ($content); | ||
close(*OUTFILE); | ||
|
||
exit(0); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
maven/sarl-maven-plugin/src-templates/functional_pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<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> | ||
<groupId>groupid</groupId> | ||
<artifactId>artifactid</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<properties> | ||
<janus.version>2.0.5.0-SNAPSHOT</janus.version> | ||
<sarl.version>0.5.0-SNAPSHOT</sarl.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>add-source</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>src/main/sarl/</source> | ||
<source>target/xtext-temp/stubs/</source> | ||
</sources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.5.1</version> | ||
<configuration> | ||
<encoding>UTF-8</encoding> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.xtext</groupId> | ||
<artifactId>xtext-maven-plugin</artifactId> | ||
<version>2.10.0</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<encoding>UTF-8</encoding> | ||
<compilerSourceLevel>1.8</compilerSourceLevel> | ||
<compilerTargetLevel>1.8</compilerTargetLevel> | ||
<failOnValidationError>true</failOnValidationError> | ||
<languages> | ||
<language> | ||
<setup>io.sarl.lang.SARLStandaloneSetup</setup> | ||
<outputConfigurations> | ||
<outputConfiguration> | ||
<createOutputDirectory>true</createOutputDirectory> | ||
<outputDirectory>target/xtext-temp/stubs/</outputDirectory> | ||
</outputConfiguration> | ||
</outputConfigurations> | ||
</language> | ||
</languages> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.sarl.lang</groupId> | ||
<artifactId>io.sarl.lang</artifactId> | ||
<version>${sarl.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.sarl.lang</groupId> | ||
<artifactId>io.sarl.lang.core</artifactId> | ||
<version>${sarl.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse</groupId> | ||
<artifactId>osgi</artifactId> | ||
<version>3.10.0-v20140606-1445</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.xtend</groupId> | ||
<artifactId>org.eclipse.xtend.core</artifactId> | ||
<version>2.10.0</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.sarl.maven</groupId> | ||
<artifactId>io.sarl.maven.sdk</artifactId> | ||
<version>${sarl.version}</version> | ||
</dependency> | ||
<!-- <dependency>--> | ||
<!-- <groupId>io.janusproject</groupId>--> | ||
<!-- <artifactId>io.janusproject.kernel</artifactId>--> | ||
<!-- <version>${janus.version}</version>--> | ||
<!-- </dependency>--> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.