Skip to content

Commit

Permalink
Revert "Use jar library instead of java files"
Browse files Browse the repository at this point in the history
This reverts commit a197915.
  • Loading branch information
SuhasDissa committed Dec 11, 2023
1 parent cc448be commit d575f5f
Show file tree
Hide file tree
Showing 38 changed files with 5,393 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed app/arity-2.1.2.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
implementation("androidx.compose.material:material-icons-extended:1.5.4")
implementation("androidx.navigation:navigation-compose:2.7.5")
implementation(files("arity-2.1.2.jar"))
implementation(project(mapOf("path" to ":arity")))
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
Expand Down
1 change: 1 addition & 0 deletions arity/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
9 changes: 9 additions & 0 deletions arity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
32 changes: 32 additions & 0 deletions arity/src/main/java/org/javia/arity/ArityException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2007-2009 Mihai Preda.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.javia.arity;

/**
* Thrown when a {@link Function} is evaluated with a wrong number of arguments
* (when the number of arguments is not equal to the function's arity).
*/

public class ArityException extends RuntimeException {
public ArityException(String mes) {
super(mes);
}

public ArityException(int nArgs) {
this("Didn't expect " + nArgs + " arguments");
}
}
51 changes: 51 additions & 0 deletions arity/src/main/java/org/javia/arity/ByteStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2008-2009 Mihai Preda.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.javia.arity;

class ByteStack {
private byte[] data = new byte[8];
private int size = 0;

void clear() {
size = 0;
}

void push(byte b) {
if (size >= data.length) {
byte[] newData = new byte[data.length << 1];
System.arraycopy(data, 0, newData, 0, data.length);
data = newData;
}
data[size++] = b;
}

/*
void pop(int cnt) {
size -= cnt;
}
*/

byte pop() {
return data[--size];
}

byte[] toArray() {
byte[] trimmed = new byte[size];
System.arraycopy(data, 0, trimmed, 0, size);
return trimmed;
}
}
Loading

3 comments on commit d575f5f

@M00NJ
Copy link
Member

@M00NJ M00NJ commented on d575f5f Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you revert it? The library is much faster to build and compile for me...

@SuhasDissa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you revert it? The library is much faster to build and compile for me...

F-droid doesn't allow precompiled jar files

@M00NJ
Copy link
Member

@M00NJ M00NJ commented on d575f5f Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dann :/

Please sign in to comment.