how can i get the .class file in my xyz.jar?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how can i get the .class file in my xyz.jar?

saikrishnaksv
This post has NOT been accepted by the mailing list yet.
my gradle script file :

apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jetty'
apply plugin: 'maven'
apply plugin: 'java'

jar.enabled = true

sourceCompatibility=1.6

project.group= 'xyz'
project.nane='xyz'
project.version=''

vendor ='Perceptive Informatics, Inc.'


//ant.importBuild 'build-dist.xml'

repositories {
    mavenCentral()
    mavenRepo url: 'http://repo.gradle.org/gradle/simple/repo1-cache'
    mavenRepo url: 'http://repository.jboss.org/nexus/content/groups/public'
    mavenRepo url: 'http://download.java.net/maven/2'
    mavenRepo url: 'http://repo.springsource.org/simple/gradle-libs'
    mavenRepo url: 'https://repository.jboss.org'

}

sourceSets{
     main{
        java { srcDirs = [] } // no source dirs
        //groovy { srcDir 'src/java' } // includes all .groovy and .java files under src
        resources{
            srcDir 'src/java'

        }
    }
}



//task publishJar(type: Jar , dependsOn:classes ) {
task publishJar(type: Jar ,dependsOn:classes) {
    from sourceSets.main.resources
    archiveName  'xyz.jar'
    destinationDir = file("./dist")

    manifest {
        attributes 'Implementation-Vendor' : vendor, 'Implementation-Version': version
    }
}




task copyJar(type: Copy ) {
    from './dist'
    into './lib/ext'
    include('**/*.jar')
}



//compileGroovy.groovyOptions.fork = false
// println relativePath(myZip.destinationDir)

dependencies{

    compile group: 'commons-logging', name: 'commons-logging-api', version: '1.0.4'
    compile group: 'org.hibernate', name: 'hibernate', version: '3.0'
    compile group: 'javax.transaction', name: 'jta', version: '1.0.1B'
    compile group: 'javax.servlet', name: 'servlet-api', version: '2.4'
    compile group: 'jdbc', name: 'jdbc', version: '2.0'

    //compile group: 'jcom.mchange', name: 'c3p0', version: '0.9.2-pre4'
    // compile group: 'org.hibernate', name: 'hibernate-core', version: '4.1.4.Final'
    //testCompile group: 'junit', name: 'junit', version: '4.8.1'


    compile fileTree(dir: 'lib', include: '*.jar')

}

my xyz.jar having the .java files.
how can i get the .class file in my xyz.jar?
thanks,
krsna.