1 Star 0 Fork 11

DengSir/rpc-repo

forked from Plato/rpc-repo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
java_pub_driver.py 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
zhongxiaogang 提交于 2022-05-11 15:33 . add java dev tools
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import shutil
import json
import platform
import sys
import subprocess
from pub_driver import Publisher
from option import Options
from xml.dom.minidom import parse
import xml.dom.minidom
class Publisher_java(Publisher):
def init(self):
self.cwd = os.getcwd().replace('\\', '/')
def publish(self, idl_name, service_name, out_dir, orig_dir):
working_path = os.getcwd()
src_path = working_path+'/src/java/'+idl_name
os.chdir(src_path)
print('change dir to '+src_path)
print("executing [mvn clean deploy]")
subprocess.call(["mvn", "clean", "deploy"], shell=True)
print("deploy maven project success")
DOMTree = xml.dom.minidom.parse(src_path+"/pom.xml")
Data = DOMTree.documentElement
groupId = Data.getElementsByTagName("groupId")[0].childNodes[0].data
artifactId = Data.getElementsByTagName("artifactId")[0].childNodes[0].data
version = Data.getElementsByTagName("version")[0].childNodes[0].data
print('''
<dependency>
<groupId>%s</groupId>
<artifactId>%s</artifactId>
<version>%s</version>
</dependency>'''% (groupId, artifactId,version))
os.chdir('../../')
return True
def check(self):
return True
def pub_service(self, idl_name, service_name, out_dir):
pass
def copy_file_windows(self, from_dir, to_dir, prefix, suffix, service_name):
pass
def copy_file_linux(self, from_dir, to_dir, prefix, suffix, service_name):
pass
def create_config_file(self, to_dir):
pass
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/DengSir/rpc-repo.git
[email protected]:DengSir/rpc-repo.git
DengSir
rpc-repo
rpc-repo
v0.3.0-alpha

搜索帮助