2
계약 프로그래밍을 위해 Google 도서관 인 Cofoja를 사용하려고합니다. 라이브러리를 성공적으로 컴파일 할 수있는 빌드 파일을 복사/붙여 넣었습니다. 나는 간단한 계약 규칙을 지정하는 하나의 주석을 추가하기 시작할 때Cofoja : 오류 : 계약서에 오류가 있습니다. 패키지 com.google.java.contract가 없습니다.
하지만, 난 더 이상 컴파일이 콘솔 출력을 얻을 수 없습니다 여기
build:
[javac] C:\Users\Admin\test\Seismi\build.xml:24: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to C:\Users\Admin\test\Seismi\build\classes
[javac] C:\Users\Admin\test\Seismi\build.xml:31: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 9 source files to C:\Users\Admin\test\Seismi\build\contracts
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract does not exist
[javac] error: error in contract: package com.google.java.contract.core.agent does not exist
[javac] error: error in contract: package com.google.java.contract.core.agent does not exist
[javac] error: error in contract: package com.google.java.contract.core.agent does not exist
[javac] C:\Users\Admin\test\Seismi\src\com\backpapp\requestmanager\IResult.java:7: error: error in contract: package com.google.java.contract does not exist
[javac] @Ensures({"result != null","!result.isEmpty()"})
[javac] ^
[javac] clause: result != null
[javac] ^
[javac] 13 errors
을 IResult.java입니다 :
import com.google.java.contract.Ensures;
public interface IResult {
@Ensures({"result != null","!result.isEmpty()"})
public String getId();
}
그리고 내 개미 파일 :
<project name="Seismi" default="dist" basedir=".">
<!-- Project directories. -->
<property name="src.dir" location="src"/>
<property name="dist.dir" location="dist"/>
<property name="lib.dir" location="libs"/>
<property name="build.dir" location="build"/>
<property name="classes.dir" location="${build.dir}/classes"/>
<property name="contracts.dir" location="${build.dir}/contracts"/>
<property name="cofoja" value="cofoja.asm.jar"/>
<path id="class.path">
<pathelement location="${lib.dir}/${cofoja}"/>
<pathelement location="${lib.dir}/json-simple-1.1.1.jar"/>
</path>
<target name="build">
<mkdir dir="${build.dir}"/>
<!-- Compiles WITHOUT contracts. -->
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="class.path"/>
<compilerarg value="-proc:none"/>
</javac>
<!-- Compiles ONLY the contracts. -->
<mkdir dir="${contracts.dir}"/>
<javac srcdir="${src.dir}" destdir="${contracts.dir}">
<classpath>
<path refid="class.path"/>
<!-- Add ${classes.dir} to the second compilation class path
so that Cofoja finds your already compiled class files. -->
<pathelement path="${classes.dir}"/>
</classpath>
<compilerarg value="-proc:only"/>
</javac>
</target>
<target name="dist" depends="build">
<mkdir dir="${dist.dir}"/>
<jar destfile="${dist.dir}/${ant.project.name}.jar">
<fileset dir="${classes.dir}"/>
<fileset dir="${contracts.dir}"/>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>
실마리가 있습니다. 나는 모든 것을 고민하고 있습니다. 이것에 하루.
를? 나는 정확히 같은 오류 (Netbeans 사용)를 얻고 있으며,이 문제를 해결하기 위해 나를 데려 오는 것을 찾을 수 없다 ... 도움은 매우 높이 평가된다. – madison54