Skip to content

Commit

Permalink
unload to maven centerrepository
Browse files Browse the repository at this point in the history
  • Loading branch information
YeDaxia committed Aug 12, 2017
1 parent fd2e3e5 commit e904924
Show file tree
Hide file tree
Showing 19 changed files with 170 additions and 15 deletions.
Binary file modified .gradle/3.3/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/3.3/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/3.3/taskArtifacts/taskArtifacts.bin
Binary file not shown.
Binary file modified .gradle/3.3/taskArtifacts/taskArtifacts.lock
Binary file not shown.
3 changes: 2 additions & 1 deletion README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ mvcFramework = [spring, play, jfinal, generic](not required,JApiDocs will try

**java code mode**

(1) use the `all` jar or the `min` jar, if you use the `min` version, don't forge to include the libraries below:
(1) add dependencies below:

```
compile 'io.github.yedaxia:japidocs:1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.github.javaparser:javaparser-core:3.3.0'
```
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public @interface ApiDoc {

如果你用的是我们深度支持的 MVC 框架,那么你只需要写好返回的视图模型就可以了。

3. 你可以在项目的目录下找到有两个,一个是`all`结尾的,里面包含了第三方的依赖包,一个是`min`结尾的,不含第三方的依赖包。
3. 集成依赖和运行程序

**命令行模式:**

Expand All @@ -83,9 +83,10 @@ java -jar ***-all.jar

**代码模式**

如果想做一些持续集成的话,代码模式还是比较方便的,根据你的需要可以选择`all`包或者`min`包,相关第三方依赖如下:
如果想做一些持续集成的话,代码模式还是比较方便的,直接添加依赖或者下载相关`jar`包,其中`min`包是不包含第三方依赖的。

```
compile 'io.github.yedaxia:japidocs:1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.github.javaparser:javaparser-core:3.3.0'
```
Expand Down
37 changes: 37 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.0
VERSION_CODE=1
GROUP=io.github.yedaxia

POM_DESCRIPTION=sonatype
POM_URL=https://github.com/YeDaxia/JApiDocs
POM_SCM_URL=https://github.com/YeDaxia/JApiDocs
POM_SCM_CONNECTION=scm:https://github.com/YeDaxia/JApiDocs.git
POM_SCM_DEV_CONNECTION=scm:https://github.com/YeDaxia/JApiDocs.git
POM_LICENCE_NAME=The Apache 2 License
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=yedaxia
POM_DEVELOPER_NAME=yedaxia
POM_DEVELOPER_EMAIL=guozhong.yale@gmail.com

SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2
1 change: 1 addition & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply from: '../uploadMaven.gradle'

group 'io.github.yedaxia'
version '1.0-min'
Expand Down
3 changes: 3 additions & 0 deletions library/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=JApiDocs Library
POM_ARTIFACT_ID=japidocs
POM_PACKAGING=jar
1 change: 0 additions & 1 deletion library/src/main/java/io/github/yedaxia/apidocs/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ public static String getJavaFileName(File javaFile){
* @param filter
* @param result
* @param stopAtFirstResult stop when first file matches
* @return
*/
public static void wideSearchFile(File rootPath, FilenameFilter filter, List<File> result, boolean stopAtFirstResult){
File[] fileList = rootPath.listFiles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

public interface IFieldProvider {
/**
*
* @param
* get response fields
* @param respNode
* @return
*/
List<FieldModel> provideEntryFields(ResponseNode respNode);
List<FieldModel> provideFields(ResponseNode respNode);
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ModelCodeGenerator(ResponseNode responseNode) {
public String generateNodeCode(ResponseNode respNode) throws IOException {
String className = respNode.getClassName();
IFieldProvider entryProvider = ProviderFactory.createProvider();
List<FieldModel> entryFields = entryProvider.provideEntryFields(respNode);
List<FieldModel> entryFields = entryProvider.provideFields(respNode);
if(entryFields == null || entryFields.isEmpty()){
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public String generateNodeCode(ResponseNode respNode) throws IOException {
String className = respNode.getClassName();

IFieldProvider entryProvider = ProviderFactory.createProvider();
List<FieldModel> entryFields = entryProvider.provideEntryFields(respNode);
List<FieldModel> entryFields = entryProvider.provideFields(respNode);

if(entryFields == null || entryFields.isEmpty()){
return "";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class DocFieldProvider implements IFieldProvider {

@Override
public List<FieldModel> provideEntryFields(ResponseNode respNode) {
public List<FieldModel> provideFields(ResponseNode respNode) {
List<FieldNode>recordNodes = respNode.getChildNodes();
if(recordNodes == null || recordNodes.isEmpty()){
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/**
*
* can apply to any java project, but you have to set the request url and method in annotation ${@link ApiDoc} by yourself.
* can apply to any java project, but you have to set the request url and method in annotation ${@link io.github.yedaxia.apidocs.ApiDoc} by yourself.
*
* @author yeguozhong yedaxia.github.com
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String toJsonApi(){
if(childNodes == null || childNodes.isEmpty()){
return "";
}
Map jsonRootMap = new LinkedHashMap<>();
Map<String, Object> jsonRootMap = new LinkedHashMap<>();
for (FieldNode recordNode : childNodes) {
toJsonApiMap(recordNode,jsonRootMap);
}
Expand All @@ -70,10 +70,10 @@ public String toJsonApi(){
}
}

public void toJsonApiMap(FieldNode recordNode, Map map){
public void toJsonApiMap(FieldNode recordNode, Map<String, Object> map){
ResponseNode childResponseNode = recordNode.getChildResponseNode();
if(childResponseNode != null){
Map childMap = new LinkedHashMap<>();
Map<String, Object> childMap = new LinkedHashMap<>();
for (FieldNode childNode : childResponseNode.childNodes) {
if(childNode.getChildResponseNode() != null){
toJsonApiMap(childNode,childMap);
Expand Down
1 change: 1 addition & 0 deletions springDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
// compile('org.springframework.boot:spring-boot-starter-data-redis')
compile('org.springframework.boot:spring-boot-starter-web')
compile 'io.github.yedaxia:japidocs:1.0'
}
Binary file removed springDemo/libs/library-1.0-SNAPSHOT.jar
Binary file not shown.
112 changes: 112 additions & 0 deletions uploadMaven.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'maven'
apply plugin: 'signing'

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}

def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}

def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
}

def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME

repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}

pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
email POM_DEVELOPER_EMAIL
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from tasks.javadoc.destinationDir
}

task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}

artifacts {
archives jar

archives javadocJar
archives sourcesJar
}
}

0 comments on commit e904924

Please sign in to comment.