Skip to content

Commit

Permalink
Migrating mixin functionality from Sponge to new project
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed Dec 14, 2014
0 parents commit dacac51
Show file tree
Hide file tree
Showing 22 changed files with 2,607 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/bin
.gradle
/build
.classpath
.project
.settings
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: java
notifications:
email: false
install: true
matrix:
include:
- jdk: openjdk6
script: gradle build
22 changes: 22 additions & 0 deletions HEADER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This file is part of Sponge, licensed under the MIT License (MIT).

Copyright (c) SpongePowered.org <http://www.spongepowered.org>
Copyright (c) contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
19 changes: 19 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
183 changes: 183 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
// Gradle repositories and dependencies
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0'
}
}

// Apply plugin
apply plugin: 'java'
apply plugin: 'license'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

// Default tasks
defaultTasks 'licenseFormat', 'check', 'build'

// Basic project information
group = 'org.spongepowered'
archivesBaseName = 'mixin'
version = '0.1-SNAPSHOT'

// Extended project information
ext.projectName = 'Mixin'
ext.inceptionYear = '2014'
ext.packaging = 'jar'
ext.url = 'http://spongepowered.org'
ext.description = 'Mixin'
ext.organization = 'SpongePowered'

// Define variables
ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0'
ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown'
ext.commit = project.hasProperty("commit") ? commit : 'unknown'

// Minimum version of Java required
sourceCompatibility = '1.6'
targetCompatibility = '1.6'

// Project repositories
repositories {
mavenCentral()
maven {
name = 'minecraft'
url = 'https://libraries.minecraft.net/'
}
}

configurations {
deployerJars // maven stuff
}

// Project dependencies
dependencies {
compile 'org.slf4j:slf4j-api:1.7.7'
compile 'com.google.guava:guava:17.0'
compile 'org.ow2.asm:asm-debug-all:5.0.3'
compile 'net.minecraft:launchwrapper:1.11'
compile 'com.google.code.gson:gson:2.2.4'
compile 'commons-io:commons-io:2.4'
testCompile 'junit:junit:4.11'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.mockito:mockito-core:1.9.0'

// maven
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.7'
}

// Filter, process, and include resources
processResources {
// Include in final JAR
from 'LICENSE.txt'
}

// License header formatting
license {
ext.name = project.name
ext.organization = project.organization
ext.url = project.url
ext.year = project.inceptionYear
exclude "**/*.info"
exclude "assets/**"
header file("HEADER.txt")
sourceSets = project.sourceSets
ignoreFailures false
strictCheck false
mapping {
java = 'SLASHSTAR_STYLE'
}
}

checkstyle {
configProperties = [
"name" : project.name,
"organization": project.organization,
"url" : project.url,
"year" : project.inceptionYear
]
configFile = file("checkstyle.xml")
}

// Source compiler configuration
configure([compileJava, compileTestJava]) {
options.compilerArgs += ['-Xlint:all', '-Xlint:-path']
options.deprecation = true
options.encoding = 'utf8'
}

// JAR manifest configuration
jar.manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": name,
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit,
"Implementation-Vendor": url)

task sourceJar(type: Jar) {
from sourceSets.main.java
from sourceSets.main.resources
classifier = "sources"
}

task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = "javadoc"
}

artifacts {
archives jar
archives sourceJar
archives javadocJar
}

uploadArchives {
repositories {

mavenDeployer {
configuration = configurations.deployerJars

if (project.hasProperty("chRepo"))
{
repository(url: project.chRepo) {
authentication(userName: project.chUsername, password: project.chPassword)
}
}

pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Sponge API'
url 'http://www.spongepowered.org/'

scm {
url 'https://github.com/SpongePowered/SpongeAPI'
connection 'scm:git:git://github.com/SpongePowered/SpongeAPI.git'
developerConnection 'scm:git:[email protected]:SpongePowered/SpongeAPI.git'
}

issueManagement {
system 'youtrack'
url 'https://issues.spongepowered.org/'
}

licenses {
license {
name 'MIT license'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
}
}
}
}
}
Loading

0 comments on commit dacac51

Please sign in to comment.