Skip to content

Commit

Permalink
Add support to publish library
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Jul 27, 2020
1 parent 5e8f993 commit c2bc223
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 11 deletions.
12 changes: 9 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="base"/>
<classpathentry kind="src" output="bin/main" path="base">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry combineaccessrules="false" kind="src" path="/adempiereFork"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
hs_err_pid*
/bin/
/.gradle/
/.settings/
/build/
/dependences/
/lib/
/dependences/
*.properties
6 changes: 6 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.babel.editor.rbeBuilder</name>
<arguments>
Expand All @@ -19,5 +24,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.jaspersoft.studio.babel.editor.rbeNature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
61 changes: 54 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
plugins {
id 'java-library'
}
apply plugin: 'java-library'
apply plugin: 'maven-publish'

repositories {
jcenter()
flatDir {
dirs 'dependences'
mavenLocal()
mavenCentral()
maven {
url = "https://maven.pkg.github.com/erpcya/Repository"
credentials {
username = System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER")
password = System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN")
}
}
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

def libraryVersion = '1.0.0'

sourceSets {
main {
java {
Expand All @@ -18,7 +27,7 @@ sourceSets {
}

dependencies {
implementation name: 'Adempiere'
compileOnly fileTree(dir: 'dependences', include: ['*.jar'])
}

jar {
Expand All @@ -44,4 +53,42 @@ task createRelease(type: Zip) {
ant.checksum file: file
}
}
}

publishing {
repositories {
maven {
url = "https://maven.pkg.github.com/erpcya/Repository"
credentials {
username = System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER")
password = System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
groupId 'org.erpya.adempiere.tools'
artifactId 'withholding'
version libraryVersion
artifact jar
pom {
name = 'ADempiere Withholding Engine'
description = 'This library have all related to Withholding Engine'
url = 'https://www.erpya.com/'
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
id = 'yamelsenih'
name = 'Yamel Senih'
email = 'ysenih@erpya.com'
}
}
}
}
}
}

0 comments on commit c2bc223

Please sign in to comment.