Skip to content

Commit 1b45d03

Browse files
author
杨利兵
committed
添加msg.android解析器
1 parent 3d65508 commit 1b45d03

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2015-2020 yanglb.com
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.yanglb.codegen.core.parser.impl;
17+
18+
import org.apache.commons.cli.Option;
19+
import org.apache.commons.cli.Options;
20+
21+
public class MsgAndroidParser extends MsgParser {
22+
@Override
23+
protected Options options() {
24+
Options options = super.options();
25+
26+
Option fn = options.getOption("fn");
27+
fn.setDescription("默认文件名为strings");
28+
29+
return options;
30+
}
31+
32+
@Override
33+
protected boolean headerHelp() {
34+
System.out.println("生成Android平台的多语言资源。");
35+
System.out.println("用法:cg msg.android file [options]");
36+
return true;
37+
}
38+
}

src/main/resources/conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ command:
3838
reader: .core.reader.impl.TableReaderImpl
3939
translator: .core.translator.impl.MsgIOSTranslatorImpl
4040
msg.android:
41-
parser: .core.parser.impl.MsgParser
41+
parser: .core.parser.impl.MsgAndroidParser
4242
generator: .core.generator.impl.MsgGeneratorImpl
4343
reader: .core.reader.impl.TableReaderImpl
4444
translator: .core.translator.impl.MsgAndroidTranslatorImpl

0 commit comments

Comments
 (0)