Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

build.gradle to publish both sources and javadoc #16

Open
wants to merge 1 commit into
base: indigo
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/genjava/templates/genjava_project/build.gradle.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 %(author)s
* Copyright (C) 2014, 2018 %(author)s
*
* 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
Expand Down Expand Up @@ -55,6 +55,30 @@ task generateSources (type: JavaExec) {
tasks.compileJava.source outputs.files
}

task docsJar(type: Jar, dependsOn: 'javadoc') {
description = 'Archive JavaDoc for %(project_name)s'
from javadoc.destinationDir
classifier = 'javadoc'
}

task sourceJar(type: Jar, dependsOn: 'classes') {
description = 'Archive Source files for %(project_name)s'
from sourceSets.main.allSource
classifier = 'sources'
}

publishing {
publications {
mavenJava(MavenPublication) {
// compiled classes jar is published to maven by default
// also publish -sources.jar
artifact sourceJar
// also publish -javadoc.jar
artifact docsJar
}
}
}

dependencies {
compile 'org.ros.rosjava_bootstrap:message_generation:[0.2,0.3)'
%(msg_dependencies)s
Expand Down