SEC-1689: Re-instate crypto as separate library (for use in non-Spring Security apps), as well as packaging with core.

This commit is contained in:
Luke Taylor 2011-06-10 00:01:25 +01:00
parent ecfffaaa3f
commit e27f655e9d
31 changed files with 48 additions and 11 deletions

View File

@ -45,6 +45,7 @@ class BundlorPlugin implements Plugin<Project> {
public class Bundlor extends DefaultTask {
@InputFile
@Optional
File manifestTemplate
@OutputDirectory
@ -69,13 +70,26 @@ public class Bundlor extends DefaultTask {
Bundlor() {
manifestTemplate = new File(project.projectDir, 'template.mf')
if (!manifestTemplate.exists()) {
logger.info("No bundlor template for project " + project.name)
manifestTemplate = null
}
inputPaths = project.files(project.sourceSets.main.classesDir)
if (manifestTemplate != null) {
project.jar.manifest.from manifest
project.jar.inputs.files manifest
}
}
@TaskAction
void createManifest() {
if (manifestTemplate == null) {
return;
}
logging.captureStandardOutput(LogLevel.INFO)
project.mkdir(bundlorDir)

View File

@ -1,5 +1,9 @@
// Core build file
// We don't define a module dependency on crypto to avoid creating a transitive dependency
def cryptoProject = project(':spring-security-crypto')
def cryptoClasses = cryptoProject.sourceSets.main.classes
dependencies {
compile 'aopalliance:aopalliance:1.0',
"net.sf.ehcache:ehcache:$ehcacheVersion",
@ -20,16 +24,22 @@ dependencies {
"cglib:cglib-nodep:$cglibVersion"
}
// jdkVersion = System.properties['java.version']
// isJdk6 = jdkVersion >= '1.6'
int maxAESKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength('AES')
compileJava.dependsOn cryptoProject.compileJava
classes.dependsOn cryptoProject.classes
classes.doLast {
copy {
from cryptoClasses
into sourceSets.main.classesDir
}
}
sourceSets.main.compileClasspath += cryptoClasses
sourceSets.test.compileClasspath += cryptoClasses
sourceJar.from cryptoProject.sourceSets.main.java
test {
systemProperties['springSecurityVersion'] = version
systemProperties['springVersion'] = springVersion
if (maxAESKeySize < 256) {
logger.warn("AES keysize limited to $maxAESKeySize, skipping EncryptorsTests")
exclude '**/EncryptorsTests.class'
}
}

12
crypto/crypto.gradle Normal file
View File

@ -0,0 +1,12 @@
// crypto module build file
// jdkVersion = System.properties['java.version']
// isJdk6 = jdkVersion >= '1.6'
int maxAESKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength('AES')
test {
if (maxAESKeySize < 256) {
println "AES keysize limited to $maxAESKeySize, skipping EncryptorsTests"
exclude '**/EncryptorsTests.class'
}
}

View File

@ -8,7 +8,8 @@ def String[] modules = [
'cas',
'openid',
'taglibs',
'aspects'
'aspects',
'crypto'
]
def String[] samples = [