Skip to content

Commit

Permalink
LPS-16814 Add build-lang goal for Maven
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.liferay.com/repos/public/portal/trunk@79292 05bdf26c-840f-0410-9ced-eb539d925f36
  • Loading branch information
mikakoivisto committed Apr 27, 2011
1 parent 863bc36 commit 82d7150
Showing 1 changed file with 73 additions and 0 deletions.
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;

}

0 comments on commit 82d7150

Please sign in to comment.