Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated added gradle 8.9 #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .classpath

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ tools/build/
out/
deps/
run/
.idea
.gradle
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "hyphanet-fred"]
path = hyphanet-fred
url = https://github.com/hyphanet/fred.git
17 changes: 0 additions & 17 deletions .project

This file was deleted.

49 changes: 0 additions & 49 deletions README

This file was deleted.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Thanks for trying Freemail!

This is the first release of Freemail, and so may (read: does) have bugs that I haven't found yet. Please do report them at http://bugs.freenetproject.org/.

Using Freemail
==============

You can compile from source:

compile: (however you compile Java, an ant buildfile is supplied)

To build with ant, create a file override.properties with content similar to
the following:

bcprov.location = <your home dir>/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.59/2507204241ab450456bdb8e8c0a8f986e418bd99/bcprov-jdk15on-1.59.jar
junit = <your home dir>/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar
hamcrest = <your home dir>/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest/3.0/8fd9b78a8e6a6510a078a9e30e9e86a6035cfaf7/hamcrest-3.0.jar

Now run `ant clean; ant`

Once you've done one of those steps, run:

java -cp ~/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.59/2507204241ab450456bdb8e8c0a8f986e418bd99/bcprov-jdk15on-1.59.jar:~/.gradle/caches/modules-2/files-2.1/org.freenetproject/freenet-ext/29/507ab3f6ee91f47c187149136fb6d6e98f9a8c7f/freenet-ext-29.jar:./hyphanet-fred/build/libs/freenet.jar:./build/classes org.freenetproject.freemail.FreemailCli

(You can also specify the address (host) and port of your Freenet node
using -h and -p respectively, if they are not the defaults).

Set up your email client to point at IMAP port 3143 and SMTP port 3025.

Feel free to Freemail me on [email protected]! If that doesn't work, my real email address is [email protected].

Good luck!
122 changes: 122 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
plugins {
id 'java'
id 'checkstyle'
}

group = 'org.freenetproject'
version = '0.0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
flatDir { dirs uri("${projectDir}/lib") }
maven {
url 'https://mvn.freenetproject.org'
metadataSources {
artifact()
}
}
mavenCentral()
}

sourceSets {
main {
java {
srcDirs = ['src/main/java', "${project.buildDir}/generated/sources/main/java"]
}
resources {
srcDirs = ['src/main/resources']
exclude '**/Version.java'
}
}
}

dependencies {
implementation project(':hyphanet-fred')
implementation 'org.bouncycastle:bcprov-jdk15on:1.59'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:3.0'

runtimeOnly 'org.freenetproject:freenet-ext:29'
}

tasks.register('getGitRevision') {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--always', '--abbrev=1', '--dirty'
standardOutput = stdout
}
ext.revision = stdout.toString().trim()
}

// Define a new task for processing Version.java
task processVersionJava(type: Copy) {
from(sourceSets.main.resources.srcDirs) {
include '**/Version.java'
}
into "${project.buildDir}/generated/sources/main/java"
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
git_revision: getGitRevision.revision,
project_version: project.version
], beginToken: '@', endToken: '@')
}

processResources {
dependsOn processVersionJava
duplicatesStrategy = DuplicatesStrategy.INCLUDE

// Exclude Version.java from main resources
from(sourceSets.main.resources.srcDirs) {
exclude '**/Version.java'
include 'org/freenetproject/freemail/l10n/*.l10n'
include 'org/freenetproject/freemail/ui/web/css/*.css'
include 'org/freenetproject/freemail/ui/web/images/**'
}
}

test {
useJUnit()
include '**/*Test.java'
systemProperty 'test.extensive', System.getProperty('test.extensive')
systemProperty 'test.verbose', System.getProperty('test.verbose')
}

checkstyle {
configFile = file("${rootDir}/checkstyle.xml")
toolVersion = '8.41'
ignoreFailures = true
}

jar {
manifest {
attributes(
'Main-Class': 'org.freenetproject.freemail.FreemailCli',
'Plugin-Main-Class': 'org.freenetproject.freemail.FreemailPlugin',
'Implementation-Title': 'Freemail',
'Implementation-Version': project.version
)
}
}

compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint'
}
compileJava.dependsOn processResources

tasks.named('compileJava') {
dependsOn(':hyphanet-fred:jar')
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

tasks.register('runApp', JavaExec) {
group = 'application'
description = 'Run the main class'
classpath = sourceSets.main.runtimeClasspath
mainClass = 'org.freenetproject.freemail.FreemailCli'
}
5 changes: 3 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!-- Libraries provided by Freenet -->
freenet.location = ../fred
freenet-cvs-snapshot.location = ${freenet.location}/dist/freenet.jar
freenet.location = ./hyphanet-fred
freenet-cvs-snapshot.location = ${freenet.location}/build/libs/freenet.jar
bcprov.location = ${freenet.location}/lib/bcprov.jar
project.version = 0.0.1-SNAPSHOT

junit = /usr/share/java/junit4.jar
hamcrest = /usr/share/java/hamcrest-core.jar
Expand Down
16 changes: 9 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<property file="build.properties"/>

<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="test" location="test"/>
<property name="src" location="src/main/java"/>
<property name="resources" location="src/main/resources"/>
<property name="test" location="src/test/java"/>
<property name="test.run" location="run"/>
<property name="build" location="build"/>
<property name="build-test" location="build-test"/>
Expand All @@ -20,7 +21,7 @@
<property name="version.src" value="org/freenetproject/freemail/Version.java"/>
<property name="version.build" value="org/freenetproject/freemail/Version.class"/>

<property name="tools.src" location="tools/src"/>
<property name="tools.src" location="src/tools/java"/>
<property name="tools.dst" location="tools/build"/>

<exec executable="git"
Expand Down Expand Up @@ -58,12 +59,13 @@
<tstamp/>

<!-- Create the Version file with patched revision number in ${build} -->
<copy file="${src}/${version.src}"
<copy file="${resources}/${version.src}"
tofile="${build}/${version.src}"
overwrite="true" />
<delete file="${build}/${version.build}" quiet="true" />
<replace file="${build}/${version.src}">
<replacefilter token="@custom@" value="${git.revision}"/>
<replacefilter token="@git_revision@" value="${git.revision}"/>
<replacefilter token="@project_version@" value="${project.version}"/>
</replace>
<echo message="Updated build version to ${git.revision} in ${build}/${version.src}"/>

Expand Down Expand Up @@ -105,7 +107,7 @@

<!-- Copy l10n and css -->
<copy todir="${build}">
<fileset dir="${src}">
<fileset dir="${resources}">
<include name="org/freenetproject/freemail/l10n/*.l10n" />
<include name="org/freenetproject/freemail/ui/web/css/*.css" />
<include name="org/freenetproject/freemail/ui/web/images/" />
Expand All @@ -125,7 +127,7 @@
encoding="UTF-8"
includeantruntime="false">
<classpath>
<pathelement location="${bouncycastle.location}"/>
<pathelement location="${bcprov.location}"/>
</classpath>
<compilerarg value="-Xlint"/>
</javac>
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading