summaryrefslogtreecommitdiff
path: root/build.gradle
blob: a3114ee5ce9ed81de014f418b5a68261e3bac902 (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
107
108
apply plugin: "groovy"
apply plugin: "maven"
apply plugin: "signing"
apply plugin: "idea"

apply from: 'gradle/integTest.gradle'

defaultTasks "build"

sourceCompatibility = 1.7
targetCompatibility = 1.7

ext {
    baseVersion = "0.6"
    isSnapshot = true
    snapshotAppendix = "-SNAPSHOT"
    projectVersion = baseVersion + (isSnapshot ? snapshotAppendix : "")
    projectGroup = "org.frege-lang"

    fregeBaseVersion = "3.23.288"
    fregeClassifier = "-gaa3af0c"
    fregeVersion = "$fregeBaseVersion$fregeClassifier"

    // work around https://issues.gradle.org/browse/GRADLE-3281
    def home = new File(System.getProperty("user.home"))
    def propfile = new File(home, ".gradle/gradle.properties")
    if (propfile.exists()) {
        props = new Properties()
        propfile.withReader {
            props.load(it)
            def keyName = "gradle.publish.key"
            def key = props.getProperty(keyName)
            if (key == null) {
                println "No key named $keyName found in ${propfile.absolutePath}"
            }
            def secretName = "gradle.publish.secret"
            def secret = props.getProperty(secretName)
            if (secret == null) {
                println "No key named $secretName found in ${propfile.absolutePath}"
            }
            if (key != null && secret != null) {
                System.setProperty "gradle.publish.key", props.'gradle.publish.key'
                System.setProperty "gradle.publish.secret", props.'gradle.publish.secret'
            }
        }
    } else println "cannot find '$propfile.absolutePath'"
}

apply from: "gradle/sonatype.gradle"

version = projectVersion
group = projectGroup

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile "$projectGroup:frege:$fregeVersion"
    compile "$projectGroup:frege-repl-core:1.2"
    compile "$projectGroup:frege-native-gen:1.3"
    compile "org.functionaljava:functionaljava:4.4"

    compile gradleApi()
    compile localGroovy()
    testCompile gradleTestKit()

    testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
        exclude module: 'groovy-all'
    }
}

// using the publishing plugin

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "com.gradle.publish:plugin-publish-plugin:0.9.1"
    }
}

// Details on how to publish to the gradle plugin portal
// Go to http://plugins.gradle.org, get yourself a publishing key
// and add it to ~/.gradle/gradle.properties as
// For publishing, run the task publishPlugins.

apply plugin: "com.gradle.plugin-publish"

// The configuration example below shows the minimum required properties
// configured to publish your plugin to the plugin portal
pluginBundle {
    website = 'https://github.com/Frege/frege-gradle-plugin'
    vcsUrl = 'https://github.com/Frege/frege-gradle-plugin'
    description = 'Enabling Frege for compilation, testing, documentation, and supporting tools.'
    tags = ['frege', 'haskell', 'java']

    plugins {
        fregePlugin {
            id = 'org.frege-lang'
            displayName = 'Frege plugin'
        }
    }
}