Compare commits

...

20 Commits

Author SHA1 Message Date
qingmo
ac22f63404 fix(gradlebuildconfig): add pom.xml & change swaggerV2 from runtime to compile for maven project (#438)
add new pom.xml generate task in jar task && change swaggerV2 from implementation to api
2022-04-26 08:34:27 +02:00
rui
aeaab37c8a ci: remove travis (#434)
* ci: remove travis

* docs: remove travis
2022-02-28 13:25:25 +01:00
ShubhamRwt
8dd6426f90 Resolving issues with build.gradle 2022-02-17 15:09:07 +05:30
ShubhamRwt
198bcfe22f Resolving issues with build.gradle 2022-02-17 15:06:50 +05:30
ShubhamRwt
3614b469d6 Resolving issues with build.gradle 2022-02-17 14:31:03 +05:30
ShubhamRwt
7d28f3344c Resolving issues with github actions 2022-02-17 12:13:26 +05:30
Shubham Rawat
32a42b1da5 Merge pull request #428 from ShubhamRwt/code
Added the sonar organization in build.gradle
2022-02-16 16:54:14 +05:30
ShubhamRwt
a9e18732c8 changes 2022-02-16 16:51:06 +05:30
ShubhamRwt
5b56e1af8a changes 2022-02-16 16:44:50 +05:30
Shubham Rawat
352977eef5 Merge pull request #425 from Swagger2Markup/githubActions
Moving from the travis.yml to github actions
2022-02-16 15:14:28 +05:30
Shubham Rawat
743624ee77 Merge pull request #424 from ShubhamRwt/releaseProcess
Moving from Bintray to Sonatype and other additional changes
2022-02-16 15:14:12 +05:30
ShubhamRwt
5f910fd564 changes 2022-02-14 14:47:25 +05:30
Shubham Rawat
fb03267275 Create gradle-build.yml 2022-02-14 14:22:05 +05:30
ShubhamRwt
c665d1f5cd changes 2022-02-14 14:16:19 +05:30
ShubhamRwt
da23c929c0 Move from bintray to SonaType 2022-02-14 14:10:11 +05:30
ShubhamRwt
7141fc094b changes 2022-02-14 13:01:32 +05:30
ShubhamRwt
f6152f6c9b changes 2022-02-14 12:52:22 +05:30
ShubhamRwt
9f89c40280 changes 2022-02-14 12:38:53 +05:30
ShubhamRwt
f60999dd9f changes 2022-02-11 16:38:55 +05:30
ShubhamRwt
a45caa4d19 changes 2022-02-11 16:34:41 +05:30
10 changed files with 112 additions and 99 deletions

82
.github/workflows/gradle-build.yml vendored Normal file
View File

@@ -0,0 +1,82 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
validation:
name: "Gradle wrapper validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
- uses: gradle/wrapper-validation-action@v1.0.4
build:
name: "Build and publish"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.5
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Cache SonarCloud packages
uses: actions/cache@v2.1.6
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build
id: gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: check
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
- name: "Comment build scan url"
uses: actions/github-script@v5
if: github.event_name == 'pull_request' && failure()
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ ${{ github.workflow }} failed: ${{ steps.gradle.outputs.build-scan-url }}'
})
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: '**/test-results/**/*.xml'
- name: Analyze with SonarCloud
continue-on-error: true
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
uses: eskatos/gradle-command-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
arguments: sonarqube -Psonar.organization=swagger2markup
dependencies-cache-enabled: true
configuration-cache-enabled: true
- name: Publish to Sonatype
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: eskatos/gradle-command-action@v1
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USER }}
ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.SONATYPE_PASSWORD }}
with:
arguments: publishToSonatype
dependencies-cache-enabled: true
configuration-cache-enabled: true

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ build
/.classpath /.classpath
/.project /.project
/.settings/ /.settings/
*.ipr
*.iws

View File

@@ -1,18 +0,0 @@
language: java
jdk:
- openjdk8
before_install:
- chmod +x gradlew
after_success:
- ./gradlew jacocoTestReport coveralls
- ./gradlew artifactoryPublish -PbintrayUsername="${BINTRAY_USER}" -PbintrayApiKey="${BINTRAY_KEY}"
- ./gradlew publishGhPages -PgithubUser="${GITHUB_USER}" -PgithubPassword="${GITHUB_PASSWORD}"
--stacktrace
notifications:
slack: swagger2markup:Zz5kz0SnvtG6aVvZUM8yMkER
env:
global:
- secure: SPKolgUdjIa/uJ+7/B/GPFlsa8IZg7NuZdFA8zROTaqew/xu+oX7qVGImseeBpPIEPJb02ac6hr7Y3/zvv0GJxIPtIbyDzVh73ImQUhT1ttLYGJfITAWqAPFF7RNNMtuOl3S2DLZ5OMJddkcFp00pa9nyI82Gk47B8GsaGIntAI=
- secure: nXXuHfvFACZwdiFM3Ta0x/f49N7cAgi0AMkgEnQrh/2xWlvQk2z2ySGJQLkhJ7Wy8LDY7Yt1b1GUt6DlP3PuFFMW/cT4iARewqiJRXZXxUQz8fpTDeTo1nmVmW/zzII6Qj3QHM3NRbR/xDOVSJiT30Hnq2hcCBQJWYsTICmzjRk=
- secure: Ia/wJ572M2II76roFeGEVCzIiktG4v2j/reSn60fpk1gnoEPQEObL4j1dbVCgXBLz54YWcaQ3mICvOfBPPEl9IIV3Y6DDE2sBOmB3soznfdA/YVnJx0h0f1pfXu1dwqoiv1sgc1wewQuUWq+FV7xeDhFE3cnh9CXIexe9ykip8k=
- secure: GWfhYDsHRmTfOuEOIcHY8kT4jKBTbdhNLDQ/2amY06xenFblb4pEn6pgmn4IdK3ytjNovnZPTOOK8HqdEjhbfIGoQt6PZwuyANn4Df+zdqOC0+V+7DFG2QhEhbRCyEwPlDqTPjxlOMfAmvjFuY/NvQywoF3PYUyMfJwUV8ehmYk=

View File

@@ -2,7 +2,7 @@
:author: Robert Winkler :author: Robert Winkler
:hardbreaks: :hardbreaks:
image:https://travis-ci.org/Swagger2Markup/swagger2markup.svg?branch=master["Build Status", link="https://travis-ci.org/Swagger2Markup/swagger2markup"] image:https://coveralls.io/repos/Swagger2Markup/swagger2markup/badge.svg["Coverage Status", link="https://coveralls.io/r/Swagger2Markup/swagger2markup"] image:https://api.codacy.com/project/badge/grade/498a6a39d7d84ff687546359f58ee18d["Codacy code quality", link="https://www.codacy.com/app/robwin/swagger2markup"] image:https://api.bintray.com/packages/swagger2markup/Maven/swagger2markup/images/download.svg[link="https://bintray.com/swagger2markup/Maven/swagger2markup/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"] image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/RobWin/swagger2markup?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"] image:https://coveralls.io/repos/Swagger2Markup/swagger2markup/badge.svg["Coverage Status", link="https://coveralls.io/r/Swagger2Markup/swagger2markup"] image:https://api.codacy.com/project/badge/grade/498a6a39d7d84ff687546359f58ee18d["Codacy code quality", link="https://www.codacy.com/app/robwin/swagger2markup"] image:https://api.bintray.com/packages/swagger2markup/Maven/swagger2markup/images/download.svg[link="https://bintray.com/swagger2markup/Maven/swagger2markup/_latestVersion"] image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"] image:https://img.shields.io/badge/Twitter-rbrtwnklr-blue.svg["Twitter", link="https://twitter.com/rbrtwnklr"] image:https://badges.gitter.im/Join%20Chat.svg[link="https://gitter.im/RobWin/swagger2markup?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
== Overview == Overview

View File

@@ -1,10 +1,9 @@
plugins { plugins {
id "org.sonarqube" version "2.7" id "org.sonarqube" version "2.7"
id "com.jfrog.bintray" version "1.8.4"
id "me.champeau.gradle.jmh" version "0.4.8" id "me.champeau.gradle.jmh" version "0.4.8"
id 'org.asciidoctor.convert' version '1.6.0' id 'org.asciidoctor.convert' version '1.6.0'
id "com.jfrog.artifactory" version "4.9.5"
id "org.ajoberstar.github-pages" version "1.7.2" id "org.ajoberstar.github-pages" version "1.7.2"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
} }
apply plugin: 'idea' apply plugin: 'idea'
apply from: "${rootDir}/libraries.gradle" apply from: "${rootDir}/libraries.gradle"
@@ -16,7 +15,6 @@ ext {
allprojects { allprojects {
apply plugin: 'jacoco' apply plugin: 'jacoco'
apply plugin: 'me.champeau.gradle.jmh' apply plugin: 'me.champeau.gradle.jmh'
apply plugin: 'com.jfrog.artifactory'
version = '2.0.0-SNAPSHOT' version = '2.0.0-SNAPSHOT'
group 'io.github.swagger2markup' group 'io.github.swagger2markup'
@@ -25,13 +23,9 @@ allprojects {
repositories { repositories {
jcenter() jcenter()
mavenCentral() mavenCentral()
maven {
name "OSS Snapshots"
url "https://oss.jfrog.org/artifactory/oss-snapshot-local"
}
} }
} }
artifactoryPublish.skip = true // apply to all projects except the root //artifactoryPublish.skip = true // apply to all projects except the root
ext { ext {
coreProjects = subprojects.findAll { coreProjects = subprojects.findAll {
@@ -41,15 +35,15 @@ ext {
configure(project.coreProjects) { configure(project.coreProjects) {
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply from: "${rootDir}/publishing.gradle" apply from: "${rootDir}/publishing.gradle"
apply plugin: 'jacoco' apply plugin: 'jacoco'
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
sourceCompatibility = "1.8" sourceCompatibility = "11"
targetCompatibility = "1.8" targetCompatibility = "11"
options.deprecation = true options.deprecation = true
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.compilerArgs += ["-Xlint:unchecked", "-parameters"] options.compilerArgs += ["-Xlint:unchecked", "-parameters"]
@@ -67,10 +61,18 @@ configure(project.coreProjects) {
} }
} }
nexusPublishing {
repositories {
sonatype()
}
}
sonarqube { sonarqube {
properties { properties {
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.organization", "swagger2markup"
property "sonar.projectName", "swagger2markup" property "sonar.projectName", "swagger2markup"
property "sonar.projectKey", "swagger2markup_swagger2markup" property "sonar.projectKey", "Swagger2Markup_swagger2markup"
property "sonar.links.homepage", "https://github.com/Swagger2Markup/swagger2markup" property "sonar.links.homepage", "https://github.com/Swagger2Markup/swagger2markup"
property "sonar.links.ci", "https://travis-ci.org/Swagger2Markup/swagger2markup" property "sonar.links.ci", "https://travis-ci.org/Swagger2Markup/swagger2markup"
property "sonar.links.scm", "https://github.com/Swagger2Markup/swagger2markup" property "sonar.links.scm", "https://github.com/Swagger2Markup/swagger2markup"
@@ -99,6 +101,10 @@ subprojects {
// exclude subprojects that don't produce a jar file or by design. // exclude subprojects that don't produce a jar file or by design.
if (!project.name.equals('swagger2markup-bom') && !project.name.equals('swagger2markup-documentation')) { if (!project.name.equals('swagger2markup-bom') && !project.name.equals('swagger2markup-documentation')) {
jar { jar {
into("META-INF/maven/$project.group/$project.name") {
from {generatePomFileForMavenJavaPublication}
rename ".*", "pom.xml"
}
inputs.property('moduleName', moduleName) inputs.property('moduleName', moduleName)
manifest.attributes( manifest.attributes(
'Automatic-Module-Name': moduleName 'Automatic-Module-Name': moduleName
@@ -110,33 +116,6 @@ subprojects {
tasks.check.dependsOn tasks.jacocoTestReport tasks.check.dependsOn tasks.jacocoTestReport
test { test {
dependsOn(subprojects.test) // required by cobertura to aggregate report dependsOn(subprojects.test) // required by cobertura to aggregate report
} }
artifactory {
contextUrl = 'https://oss.jfrog.org'
resolve {
repository {
repoKey = 'libs-release'
maven = true
}
}
publish {
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
//~/.gradle/gradle.properties, otherwise to be set in the build server
username = project.hasProperty('bintrayUsername') ? project.bintrayUsername : System.getenv('BINTRAY_USER')
password = project.hasProperty('bintrayApiKey') ? project.bintrayApiKey : System.getenv('BINTRAY_KEY')
}
defaults {
publications('mavenJava')
}
}
if (System.properties['https.proxyHost']) {
clientConfig.proxy.host = System.properties['https.proxyHost']
clientConfig.proxy.port = System.properties['https.proxyPort'].toInteger()
}
}

View File

@@ -44,38 +44,6 @@ artifacts {
archives javadocJar archives javadocJar
} }
bintray {
user = project.hasProperty('bintrayUsername') ? project.property('bintrayUsername') : ''
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : ''
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
publications = ['mavenJava']
pkg {
repo = 'Maven'
name = "${projectArtifactId}"
userOrg = "${projectArtifactId}"
websiteUrl = "${projectUrl}"
issueTrackerUrl = issuesUrl
vcsUrl = scmUrl
desc = project.description
licenses = ['Apache-2.0']
version {
name = project.version
vcsTag = "v${project.version}"
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
//Optional. The passphrase for GPG signing'
passphrase = project.hasProperty('gpgPassphrase') ? project.property('gpgPassphrase') : ''
}
mavenCentralSync {
sync = true //Optional (true by default). Determines whether to sync the version to Maven Central.
user = project.hasProperty('ossUser') ? project.property('ossUser') : '' //OSS user token
password = project.hasProperty('ossPassword') ? project.property('ossPassword') : '' //OSS user password
}
}
}
}
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {

View File

@@ -20,15 +20,15 @@ package io.github.swagger2markup.markup.builder;
public enum LineSeparator { public enum LineSeparator {
/** /**
* Line separator for Unix systems (<tt>\n</tt>). * Line separator for Unix systems (<code>\n</code>).
*/ */
UNIX("\n"), UNIX("\n"),
/** /**
* Line separator for Windows systems (<tt>\r\n</tt>). * Line separator for Windows systems (<code>\r\n</code>).
*/ */
WINDOWS("\r\n"), WINDOWS("\r\n"),
/** /**
* Line separator for Macintosh systems (<tt>\r</tt>). * Line separator for Macintosh systems (<code>\r</code>).
*/ */
MAC("\r"); MAC("\r");

View File

@@ -20,15 +20,15 @@ package io.github.swagger2markup.config;
public enum LineSeparator { public enum LineSeparator {
/** /**
* Line separator for Unix systems (<tt>\n</tt>). * Line separator for Unix systems (<code>\n</code>).
*/ */
UNIX("\n"), UNIX("\n"),
/** /**
* Line separator for Windows systems (<tt>\r\n</tt>). * Line separator for Windows systems (<code>\r\n</code>).
*/ */
WINDOWS("\r\n"), WINDOWS("\r\n"),
/** /**
* Line separator for Macintosh systems (<tt>\r</tt>). * Line separator for Macintosh systems (<code>\r</code>).
*/ */
MAC("\r"); MAC("\r");

View File

@@ -1,7 +1,7 @@
apply plugin: 'org.asciidoctor.convert' apply plugin: 'org.asciidoctor.convert'
apply plugin: 'org.ajoberstar.github-pages' apply plugin: 'org.ajoberstar.github-pages'
artifactoryPublish.skip=true //artifactoryPublish.skip=true
sonarqube.skipProject=true sonarqube.skipProject=true
asciidoctor.dependsOn test asciidoctor.dependsOn test

View File

@@ -28,7 +28,7 @@ dependencies {
implementation implLibraries.guava implementation implLibraries.guava
implementation implLibraries.paleo implementation implLibraries.paleo
implementation implLibraries.slf4j implementation implLibraries.slf4j
implementation implLibraries.swaggerV2 api implLibraries.swaggerV2
implementation implLibraries.vavr implementation implLibraries.vavr
testImplementation testLibraries.assertj testImplementation testLibraries.assertj
testImplementation testLibraries.assertjDiff testImplementation testLibraries.assertjDiff