summaryrefslogtreecommitdiffstats
path: root/proxy/buildfile
blob: ef5bf38ec4bedd21ff445ef118b82a97f0ac5f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Generated by Buildr 1.3.5, change to your liking
# Version number for this release
VERSION_NUMBER = "1.0.0"
# Group identifier for your projects
GROUP = "candlepin"
COPYRIGHT = ""

#AXIS2 = 'candlepin:axis2:jar:1.2'
#AXIS2 = 'org.apache.axis2:axis2:jar:1.2'
JERSEY = [group('jersey-core', 'jersey-json', 'jersey-server', 'jersey-client', :under=>'com.sun.jersey', :version=>'1.1.2-ea'),
        'javax.persistence:persistence-api:jar:1.0.2' ,
        'org.codehaus:jettison:jar:1.1',
        'org.apache:xalan-j2:jar:2.6.0',
        'javax.ws:jsr311-api:jar:1.1' ]
JUNIT = 'junit:junit:jar:4.5'
LOG4J = 'log4j:log4j:jar:1.2.14'
HIBERNATE = ['org.hibernate:hibernate3:jar:3.3.2',
             'org.hibernate:hibernate-annotations:jar:3.4.0',
             'org.hibernate:hibernate-commons-annotations:jar:3.4.0',
             'org.hibernate:hibernate-entitymanager:jar:3.4.0',
             'org.hibernate:hibernate-tools:jar:3.2.4',
             'antlr:antlr:jar:2.7.6',
             'org.objectweb.asm:asm:jar:3.1',
             'net.sf.cglib:cglib:jar:2.2',
             'javassist:javassist:jar:3.9.0.GA',
             'javax.transaction:jta:jar:1.1',
             'org.slf4j:slf4j-api:jar:1.5.8',
             'org.slf4j:slf4j-simple:jar:1.5.8',
             'org.freemarker:freemarker:jar:2.3.15' ]
DB = 'org.postgresql:postgresql:jar:8.4-701'
COMMONS = ['org.apache.commons:commons-collections:jar:3.1',
           'org.apache.commons:commons-logging:jar:1.1.1',
           'org.apache.commons:commons-codec:jar:1.4',
           'org.apache.commons:commons-beanutils:jar:1.7.0']
JDOM = 'org.jdom:jdom:jar:1.0'
DOM4J = ['dom4j:dom4j:jar:1.6.1']
HSQLDB = ['hsqldb:hsqldb:jar:1.8.0.10']

BOUNCYCASTLE = group('bcprov', 'bcpg', :under=>'org.bouncycastle', :version=>'1.43')
GUICE =  [group('guice', 'guice-assistedinject', 'guice-multibindings', 'guice-servlet', 'guice-throwingproviders', :under=>'com.google.guice', :version=>'2.0'),
           'com.wideplay.warp:warp-persist:jar:2.0-20090214',
           'com.sun.jersey:jersey-guice:jar:1.1.4.1',
           'aopalliance:aopalliance:jar:1.0',
           'javax.servlet:servlet-api:jar:2.5']


# causes GET /org/apache/axis2/axis2/1.2/axis2-1.2.jar
# we want GET /candlepin/axis2-1.2.jar

#OPENJPA = ['org.apache.openjpa:openjpa-all:jar:0.9.7',
#  'net.sourceforge.serp:serp:jar:1.12.0']


#repositories.remote << "http://download.java.net/maven/2/"
# Specify Maven 2.0 remote repositories here, like this:
repositories.remote << "http://jmrodri.fedorapeople.org/ivy/candlepin"
repositories.remote << "http://www.ibiblio.org/maven2/"
#repositories.remote << "http://127.0.0.1/"

desc "The Proxy project"
define "candlepin" do

  project.version = VERSION_NUMBER
  project.group = GROUP
  manifest["Implementation-Vendor"] = COPYRIGHT
  compile.options.target = '1.5'

  compile.with COMMONS, DB, JERSEY, LOG4J, HIBERNATE, BOUNCYCASTLE, JDOM, GUICE
    
  test.setup do |task|
    filter('src/test/java').exclude('*.java').into('target/test/classes').run 
  	filter('src/main/webapp/META-INF').into('target/classes/META-INF').run
  end
  test.teardown { rm_rf 'target/classes/META-INF' }
  test.with COMMONS, DB, JERSEY, JUNIT, LOG4J, HIBERNATE, BOUNCYCASTLE, JDOM, DOM4J, HSQLDB, GUICE

  #javadoc projects
  package(:war)
  
  #to use: buildr candlepin:schema_gen
  task :schema_gen do  
    begin
      ant('gen-schema') do |ant|
        rm_rf 'target/schemagen'
        mkdir_p 'target/schemagen'
      	filter('src/main/webapp/META-INF').into('target/classes/META-INF').run
  
        ant.taskdef :name=>'schema',
          :classname=>'org.hibernate.tool.ant.HibernateToolTask',
          :classpath=>Buildr.artifacts([HIBERNATE, HSQLDB, DB, COMMONS, LOG4J, JDOM, DOM4J, JERSEY]).each(&:invoke).map(&:name).join(File::PATH_SEPARATOR)
      
        ant.schema :destdir=>'target/schemagen' do
          ant.classpath :path=>_('target/classes')
          ant.jpaconfiguration :persistenceunit=>'production'
          ant.hbm2ddl :export=>'false', :update=>'false', :drop=>'false', :create=>'true', 
            :outputfilename=>'candlepin-proxy.sql', :delimiter=>';', :format=>'false', :haltonerror=>'true'
        end
      end
    ensure
      rm_rf 'target/classes/META-INF'
    end
  end
  
end