forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPS-16814 Add build-lang goal for Maven
git-svn-id: svn://svn.liferay.com/repos/public/portal/trunk@79292 05bdf26c-840f-0410-9ced-eb539d925f36
- Loading branch information
1 parent
863bc36
commit 82d7150
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
...plugins/liferay-maven-plugin/src/main/java/com/liferay/maven/plugins/LangBuilderMojo.java
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,73 @@ | ||
/** | ||
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
*/ | ||
|
||
package com.liferay.maven.plugins; | ||
|
||
import com.liferay.portal.kernel.util.FileUtil; | ||
import com.liferay.portal.kernel.util.HttpUtil; | ||
import com.liferay.portal.tools.LangBuilder; | ||
import com.liferay.portal.util.FileImpl; | ||
import com.liferay.portal.util.HttpImpl; | ||
|
||
import org.apache.maven.plugin.AbstractMojo; | ||
import org.apache.maven.plugin.MojoExecutionException; | ||
|
||
/** | ||
* @author Mika Koivisto | ||
* @goal build-lang | ||
*/ | ||
public class LangBuilderMojo extends AbstractMojo { | ||
|
||
public void execute() throws MojoExecutionException { | ||
try { | ||
initPortal(); | ||
|
||
doExecute(); | ||
} | ||
catch (Exception e) { | ||
throw new MojoExecutionException(e.getMessage(), e); | ||
} | ||
} | ||
|
||
protected void doExecute() throws Exception { | ||
new LangBuilder(langDir, langFile, langCode); | ||
} | ||
|
||
protected void initPortal() { | ||
FileUtil fileUtil = new FileUtil(); | ||
|
||
fileUtil.setFile(new FileImpl()); | ||
|
||
HttpUtil httpUtil = new HttpUtil(); | ||
|
||
httpUtil.setHttp(new HttpImpl()); | ||
} | ||
|
||
/** | ||
* @parameter default-value="${basedir}/src/main/resources/content" expression="${langDir}" | ||
* @required | ||
*/ | ||
private String langDir; | ||
|
||
/** | ||
* @parameter expression="${langCode}" | ||
*/ | ||
private String langCode; | ||
|
||
/** | ||
* @parameter default-value="Language" expression="${langFile}" | ||
*/ | ||
private String langFile; | ||
|
||
} |